"with" still sucks + removing features + adding features

Derek Parnell derek at psych.ward
Mon May 18 20:43:48 PDT 2009


On Mon, 18 May 2009 21:58:19 -0500, Andrei Alexandrescu wrote:

> Derek Parnell wrote:
>> On Mon, 18 May 2009 19:53:51 -0400, bearophile wrote:
>> 
>>> Bill Baxter:
>>>> Thinking about it more, I guess you must actually be seeing it as a
>>>> rule of   " '..' always does the most useful thing",
>>> Such attitude/purposes have created the monkey mess named Perl :-]
>> 
>> I submit the D words 'static', 'auto' and 'scope' as examples of this too.
> 
> When was the last time you had trouble with "static"? Can you show a 
> snippet of code that's confusing because of it?

"not having a trouble" and "not being consistant" are two different things.

For example, I have no trouble with ".." meaning exclusive range inside a
'[' ']' pair, and an inclusive range in a 'case' statement. That does not
trouble me at all and yet it is an inconsistancy.

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?

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



More information about the Digitalmars-d mailing list