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

Era Scarecrow rtcvb32 at yahoo.com
Sat Jul 19 20:09:08 PDT 2008


JAnderson Wrote:
> I guess that could be useful.  One way you could do prime numbers is 
> with a string mixin.  However you couldn't do anything that relies on 
> stuff available at run-time with that.


 I wasn't meaning strictly prime numbers, it's just a good example to connect code to. I was meaning, being able to use a compiled function (or a function we can compile and run without having to keep) in order to fill in some static data. Requirements? How about for those functions that you can duplicate your data with only what you input to it, and no real library/filesystem help. But most of those examples are mathematically easy to program.

 At the very worse case i suppose you could just do a module level this() that builds the data when the module is loaded, but some data is better off being static to start with rather than filling in every time. That way i can have it fill out X number range, and only give it in source code something like 1-2 functions or 400 bytes to fill in data that could take up a few K.

 Could someone refer me to the 'maps' and other 'lazy' shortcuts that i see mentioned in the other examples? They might be good to use at once time or another. 

 Era



More information about the Digitalmars-d mailing list