News for hackers. Stuff that matters.
Re:Ask HN: How to compose two mapping functions into a third? by gruseom on Thursday December 11, 2008 @01:55AM (#394066)
Yes, I'm beginning to think the simple solution to this boils down to some flavor of coroutines/continuations/laziness - basically, the stuff that Scheme has that CL does not.

The reason I find this interesting is that it's the first real problem I've run into where CL didn't have an easy way to do what I want. There are workarounds, of course. But it's interesting to run into a production (as opposed to academic) problem where the elegant solution isn't simply available.

Re:Ask HN: How to compose two mapping functions into a third? by simonb on Thursday December 11, 2008 @02:43AM (#394108)
Have you tried (semi-standard) SERIES?

http://series.sourceforge.net

"A series is a data structure much like a sequence, with similar kinds of operations. The difference is that in many situations, operations on series may be composed functionally and yet execute iteratively, without the need to construct intermediate series values explicitly. In this manner, series provide both the clarity of a functional programming style and the efficiency of an iterative programming style."

Re:Ask HN: How to compose two mapping functions into a third? by gruseom on Saturday December 13, 2008 @11:31PM (#397218)
No, I haven't tried it. In fact, I didn't know it was available open-source. Do you use it? If so, do you like it?
Re:Ask HN: How to compose two mapping functions into a third? by silverlake on Thursday December 11, 2008 @11:22AM (#394406)
You can implement the local transformations for short cut deforestation with CL macros. Then you can easily reuse the technique everywhere. Look up Andy Gill's paper from 1993.
Re:Ask HN: How to compose two mapping functions into a third? by gruseom on Thursday December 11, 2008 @11:42AM (#394429)
Google brings up a few papers from around that time. The closest match looks like "A short cut to deforestation" - is that the one you mean?

http://portal.acm.org/citation.cfm?id=165214