On Wed, 2009-05-27 at 18:07 +1000, Ramana Kumar wrote: > This is a version I found by searching my emails... I haven't used it > in a while, but I think this might be the latest. > > (define-syntax compose > (syntax-rules () > ((_) (lambda a (apply values a))) > ((_ p p* ...) (lambda a (call-with-values (lambda () (apply p a)) > (compose p* ...)))))) > > The multiple values stuff (whose syntax takes up the bulk of the code) > isn't crucial - just for generality.
I love multiple return values. Especially proper zero return values as Ikarus, Chez, and PLT (and probably others) do, which nothing else (lists, records, etc.) can emulate (I believe). > In this case your version might be better because you only create two > closures. And my compose is a first-class procedure. (I've also just changed it to do the (reverse procs) only once.) -- : Derick ----------------------------------------------------------------
