Andrei Alexandrescu:
Well there's a tension here: good language design generally
aims at providing few general features applicable to many use
cases. Encoding particular use cases in the language is
warranted by either disproportionate frequency in use or
disproportionate difficulty in implementing them within the
language. I don't think this particular feature scores very
highly in either category.
It's a feature that I use about in every Python module/package
I've written, and it's about as equally used in code you see in
Python repositories. So it's a common need in Python. I'm asking
for it for more than three years or so.
And regarding the implementation my "hack" means having a single
compile-time constant (plus a switch to be used when you want
partial compilation?). Better designs are possible, but it's a
matter of how much you want to work for it.
Bye,
bearophile
- Re: D seems interesting, but... bearophile
- Re: D seems interesting, but... Regan Heath
- Re: D seems interesting, but... Walter Bright
- Re: D seems interesting, but... Jacob Carlborg
- Re: D seems interesting, but... bearophile
- Re: D seems interesting, but... Paulo Pinto
- Re: D seems interesting, but... Andrei Alexandrescu
- Re: D seems interesting, but... foobar
- Re: D seems interesting, but... Andrei Alexandrescu
- Re: D seems interesting, but... foobar
- Re: D seems interesting, but... bearophile
- Re: D seems interesting, but... Andrei Alexandrescu
- Re: D seems interesting, but... bearophile
- Re: D seems interesting, but... 1100110
- Re: D seems interesting, but... Adam D. Ruppe
- Re: D seems interesting, but... bearophile
- Re: D seems interesting, but... foobar
- Re: D seems interesting, but... bearophile
- Re: D seems interesting, but... bearophile
- Re: D seems interesting, but... Era Scarecrow
- Re: D seems interesting, but... jerro