Im trying to implement some features of functional programming in C++. I think lazy lists can be useful since we can create infinite lists in some functional languages too. Imagine a very big list being traversed by an iterator and for some reason when the iterator reaches a certain Node the loop is over. In this case it isnt necessary to have the entire big list in memory. It is only one point that came to my mind.
On 6/15/07, Thomas Hruska <[EMAIL PROTECTED]> wrote: > > Bruno Mayerle Leite wrote: > > I got that: > > > http://www-static.cc.gatech.edu/~yannis/fc++/boostpaper/fcpp.sectlazy.html<http://www-static.cc.gatech.edu/%7Eyannis/fc++/boostpaper/fcpp.sectlazy.html> > > > > On 6/15/07, Thomas Hruska <[EMAIL PROTECTED]<thruska%40cubiclesoft.com>> > wrote: > >> brunomayerleleite wrote: > >>> Hello guys, > >>> > >>> I need a simple implementation of lazy-lists > >>> > >>> I tried FC++ approach but I couldnt get the point. Do you have some > >>> reference or code to point? > >>> > >>> Thanks in advance. > >>> Bruno. > >> Got a definition of lazy lists? Google doesn't bring up the usual > >> Wikipedia article...which is kind of surprising. > > Ah. So a linked list that doesn't create nodes until the application > asks for them implicitly. The example of an infinitely recursive list > seems to maintain two nodes through the whole process (except for the > first node?). > > Personally, I see no use for this. Implicit execution is a great way to > run into trouble (especially if someone else works on the software later > on down the road). I do _SOME_ implicit execution in Block<> (when > referencing out-of-bounds elements, I resize the memory so it won't > crash) but I try to use SetSize() wherever possible as the implicit > method _can_ chew CPU (the [] operator is a function call). > > So now my question is: What _exactly_ do you need to do with lazy lists? > > -- > Thomas Hruska > CubicleSoft President > Ph: 517-803-4197 > > *NEW* VerifyMyPC 2.5 > Change tracking and management tool. > Reduce tech. support times from 2 hours to 5 minutes. > > http://www.CubicleSoft.com/VerifyMyPC/ > > > [Non-text portions of this message have been removed]
