lazy redux

Pelle Månsson pelle.mansson at gmail.com
Sun Dec 6 05:05:34 PST 2009


Andrei Alexandrescu wrote:
> Should we sack lazy? I'd like it to have a reasonable replacement. Ideas 
> are welcome!
> 
> Andrei
I think they are broken as they are not really lazy, but just convenient 
syntax for passing delegates.

In my mind, a lazy parameter should evaluate just once, and save that 
value. In case of further usage, it should use the saved value instead.

This is actually how I thought they worked until I saw Walter's example 
with writef(x++).



More information about the Digitalmars-d mailing list