reddit - lazy evaluation of function arguments

Sean Kelly sean at invisibleduck.org
Mon Jun 30 20:40:55 PDT 2008


== Quote from Georg Wrede (georg at nospam.org)'s article
> Walter Bright wrote:
> > http://www.reddit.com/info/6pkri/comments/
> ...
> http://www.digitalmars.com/d/2.0/lazy-evaluation.html
> Hmm. I guess I should've kept a log of all my original suggestions... :-)
> Incidentally, the first few examples and cases are not all too
> convincing (not too much reduction in code lines or complexity), which
> is why I guess a lot of readers quit before the end, where there
> actually is one compelling example. And probably a number of readers
> (who aren't familiar and used to lazy evaluation somewhere else)
> are left with the thought that it isn't all too good for other than
> precisely the last example.
> But I can't figure out how to improve the page either. :-(

The most compelling use of lazy functions I've found is for logging
purposes--you only pay for the computation when the proper log
level is activated.  The Tango logging package makes extensive use
of them for this reason.


Sean


More information about the Digitalmars-d-announce mailing list