
On Mon, 17 Jan 2005 11:31:36 -0700, Jonathan Turkanis <technews@kangaroologic.com> wrote:
Bruno MartÃnez Aguerre wrote:
Coroutines or threads are overkill for this problem, IMHO. What you need is laziness, as in haskell. FC++ probably can handle decompress with less overhead than threads.
I'm not sure what you mean. The algorithm Daniel mentioned can be implemented efficiently in the current framework. The question is whether it can be simplified without sacrificing performance.
You can write decompress as a FC++ function taking and returning lazy lists, in the straight-forward way. FC++'s lists can be contructed from a pair of iterators, which are used lazily, and can be converted to forward iterators themselves, so it should be possible to interface FC++ with the current framework.
If you think this can be done with FC++, please post some code.
I don't have FC++ installed, but what I say should be possible according to: http://www.cc.gatech.edu/~yannis/fc++/boostpaper/fcpp.sectrelation.html#id27... A Haskell implementation can be found here: http://community.moertel.com/ss/space/Talk+-+Haskell+for+Perl+Hackers/pgh-pm... page 74. Regards, Bruno