Possible Lazy Keyword? (Re: Array comprehensions and the like)

Stewart Gordon smjg_1998 at yahoo.com
Sun Jul 20 18:08:34 PDT 2008


"Era Scarecrow" <rtcvb32 at yahoo.com> wrote in message 
news:mailman.31.1216481994.32098.digitalmars-d at puremagic.com...
<snip>
> I do have a serious question then, why note have inserted code that
> can be run at compile-time in order to build the static data?
> Assume the following.

D already has something called compile-time function evaluation, which I 
beleve can achieve things like this.
http://www.digitalmars.com/d/1.0/function.html#interpretation

> bool []primes = {0,0,1,1,0,1,0,1/*. etc. etc.*/} //0-7 primes, 1 is true
>
> however i have a code that already gives me this information but i
> merely need it to be present elsewhere.  If the 'lazy' keyword was
> introduced, Would it not be nifty if i could let the compiler do it
> for me?
<snip>

D already has a 'lazy' keyword.
http://www.digitalmars.com/d/1.0/lazy-evaluation.html

But its semantics are nothing like what I can make of what you're 
describing.

Stewart.

-- 
My e-mail address is valid but not my primary mailbox.  Please keep replies 
on the 'group where everybody may benefit. 




More information about the Digitalmars-d mailing list