lazy redux
Michal Minich
michal.minich at gmail.com
Mon Dec 7 04:17:57 PST 2009
Hello Michel,
>
> void logIfFalse(bool condition, pure lazy string message);
>
> logIfFalse(i == 1, createMessage());
I like the idea that of restricting what is passed into function;
void logIfFalse(bool condition, lazy pure nothrow @safe string message);
In wich case, expression passed needs to be checked for these restrictions.
But I would leave the semantics of current lazy as is, or with one adjustment:
It would be better if the compiler could make sure it is executed only zero
or one time (but I don't think it has much practical advantage).
More information about the Digitalmars-d
mailing list