Lazy eval

Frank Benoit keinfarbton at nospam.xyz
Mon Aug 21 16:50:00 PDT 2006


> The problem with requiring the { } around the argument is that
> programmers just don't like it. I don't think I can make them like it.

I am a programmer. I like them. I like to understand my and foreign
code. I hate C++ for that reason. All the time i have to look in hundred
files and have thousands of informations to care about only to get a
clue of what is going on.

Implicit or explicit, this is really an important step.
A decision between readability in big projects and nice looking example
code.

http://www.digitalmars.com/d/overview.html
 Who D is For
 Teams who write apps with a million lines of code in it.

Look at the example with explicit delegates:

void foo()
{
    int v = 2;
    cond
    ({
	scase(v == 1, {writefln("it is 1")}),
	scase(v == 2, {writefln("it is 2")}),
	scase(v == 3, {writefln("it is 3")}),
	scase(true,   {writefln("it is the default")})
    });
}

Why should one not like it? It looks sexy ;D






More information about the Digitalmars-d mailing list