version vs. static if

Nick Sabalausky a at a.a
Fri Sep 23 14:54:32 PDT 2011


"Jonathan M Davis" <jmdavisProg at gmx.com> wrote in message 
news:mailman.96.1316813793.26225.digitalmars-d at puremagic.com...
> On Friday, September 23, 2011 14:14 Nick Sabalausky wrote:
>> "Adam Ruppe" <destructionator at gmail.com> wrote in message
>> news:j5iac7$2ole$1 at digitalmars.com...
>>
>> >I hope there's no D3 for a very long time. Maybe 2020.
>>
>> I still hope there is one at some not-too-distant point, though. The 
>> whole
>> version system really does need an overhaul. One of the big things, if 
>> not
>> the key one, is that basing it on "symbol defined" vs "symbol not 
>> defined"
>> (rather than a compile-time bool) is far too problematic.
>
> That's by design. That's the way that Walter wants it. I wouldn't expect 
> that
> to change in any future version of D unless you can come up with a really 
> good
> argument to change Walter's mind or someone else takes over as the 
> benevolent
> dictator at some point.
>

Really? I had no idea. What's the reasoning? (I honestly can't imagine 
anything.)

One big problem with it, off the top of my head, is that there's zero safety 
from mistyping:

// Crap, this should be FrizzBang:
version(Fizzbang)
{...}
else
{...}

And that's silently accepted and results in the wrong code. Crap, this is 
the whole damn reason we have variable declarations in the first place.

I seem to remember there being another issue or two, but I don't recall 
offhand what.





More information about the Digitalmars-d mailing list