Final by default?

Nick Treleaven ntrel-public at yahoo.co.uk
Thu Mar 13 06:17:35 PDT 2014


On 12/03/2014 23:50, Walter Bright wrote:
>> However, it is not possible to get to the "else" part of that version
>> block
>> using the above syntax. Would the same syntax work for version as well?
>>
>>      version(something):
>>          // ...
>>
>>      !version(something):
>>          // ...
>
> Yes, this has come up before, in various forms. The short answer is
> unequivocably "no". I've expounded on this extensively in this n.g., but
> don't have a reference handy.

Some discussion here:
https://d.puremagic.com/issues/show_bug.cgi?id=7417

I understand the argument about not allowing version(X && Y), but I do 
think this construct is ugly:

version(Foo) {} else { //code

Defining a version identifier NotFoo as well as Foo would be a bad solution.

What's wrong with:

version(!Foo) {}

?


More information about the Digitalmars-d mailing list