"with" still sucks + removing features + adding features

Derek Parnell derek at psych.ward
Mon May 18 21:17:55 PDT 2009


On Mon, 18 May 2009 23:05:03 -0500, Andrei Alexandrescu wrote:

> Derek Parnell wrote:
>> But back to your question ... here is 'static' used with three different
>> meanings within three lines of code.
>> 
>> -------
>> module xyzzy;
>> import std.stdio;
>> 
>> version(X) const int y = 1;
>> else       const int y = -1;
>>            
>> static this() {
>>    static if (y == 1) 
>>       static int x = 0;
>>    else
>>       static int x = 42;
>>  
>>    writefln("X=%d Y=%d", x,y);
>> }
>> 
>> void main()
>> {
>>    
>> }
>> 
>> ----------
>> 
>> But maybe that's just me?
> 
> Doesn't confuse me one bit.

That's nice.

-- 
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell



More information about the Digitalmars-d mailing list