Const template

Lionello Lunesu lionello at lunesu.remove.com
Sun Jan 21 13:12:51 PST 2007


"Andrei Alexandrescu (See Website For Email)" 
<SeeWebsiteForEmail at erdani.org> wrote in message 
news:45B3AB3F.5040707 at erdani.org...
> Me too. I actually thought lazy is a storage class. It sure has the syntax 
> of one in definition. It changes the use syntax (requires parens). And if 
> I look at
>
> http://www.digitalmars.com/d/lazy-evaluation.html
>
> I see that lazy *is* a storage class.
>
> My original suggestion was to simply convert expressions to delegates 
> automatically. That setup has its own problems, but I think it's much 
> easier to deal with them than it is with lazy.
>
> A template can't detect lazy properly. It's unclear what it means to 
> assign to a lazy parameter. Lazy is a storage class that changes the 
> access syntax. I believe lazy is ill-designed. Walter should have stood 
> the pressure and refuse to implement it without a clear definition.

I'm not sure how we got from 'const' to 'lazy' :) but let me just say that I 
think there's a lot of potential for lazy evaluation and I was very exited 
when Walter added the implicit conversion from expressions to delegates. I'm 
not sure what the problem with the keyword "lazy" is though (other than 
maybe its grammar). At the moment, I think of the keyword "lazy" as a 
shorter way to declare a delegate. A type saver, much like "length", if you 
will : D

Seriously though, I remember the last time I was excited about something 
similar. It was in the computer architecture class at the university and we 
were presented some NEC data flow processor. It was a CPU without an 
instruction pointer. Just packages of data with code attached. It was quite 
eliberating to see a totally different way of doing things. I think 
delegates/lazy-evaluation are a big step towards this kind of flow-based 
programming.

http://en.wikipedia.org/wiki/Flow-based_programming

L.





More information about the Digitalmars-d mailing list