
On Sun, Jan 18, 2009 at 6:14 AM, Sebastian Redl < sebastian.redl@getdesigned.at> wrote:
Zachary Turner wrote:
Has this been considered before, and can anyone think of any technical limitations that would prevent such a class to be written?
Do you have a motivating use case for such lists?
Sebastian
I don't have an immediate need for one if that's what you mean, but in the past when I have done programming in functional languages I have always found them extraordinarily useful and would find uses for them even when I wasn't really expecting to. These days, however, I do much less mathematical / scientific programming which is where they tend to find most of their applications. While it is not exactly a practical usage, one of the easiest-to-describe problems that lazy lists provide a particularly elegant solution to is ascending order generation of hamming numbers. I'm not quite sure I agree though that it's simply a functional "idiom". I think it's a general programming idiom, that just so happens to be easier to implement in functional languages. But even Mpl has started to adopt certain aspects of lazy evaluation. I think lazy lists can allow elegant and expressive specification and description of problems that can otherwise be quite difficult to express without them, regardless of language. But of course if it really isn't practical to implement in C++ then I can just scratch the idea :)