Thank you Steve, The original code was a translation of a Haskell program from a discussion on [expressivity of "idiomatic C++"] on LtU. A later version uses generators which gave rise to nearly a million values (took a long time) and there is a variation on a theme that generates all the hamming numbers in the first million using the correct boundary condition values. But neither of these is lazy.
I like the fact that you have come up with a lazy version in an imperative language - might just get some discussion going. I would like to submit your version (if I may and attribute it to you) to the discussion as Icon has been mention during the discussion. I need to do more programming in ICON/UnIcon to get a better feel for the language. I tend to write small utility scripts when doing data analysis only. [[----- Steve Wampler wrote: > > Steve Wampler wrote: > > While it uses co-expressions (lots of them, in fact), I'm pretty sure > > it wouldn't be hard to rewrite it to remove the co-expressions also. > > That would probably reduce the memory footprint significantly. Yes, replacing the previous implementation of the Triplet class with: ----]] -- regards Bruce Rennie (God's Own Country Downunder) Warragul. Victoria. Australia. ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Unicon-group mailing list Unicon-group@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/unicon-group