[plt-scheme] Reimplementation of srfi-26 (cut and cute)

From: Lauri Alanko (la at iki.fi)
Date: Sat Jan 21 20:13:43 EST 2006

On Sun, Jan 22, 2006 at 02:57:39AM +0200, Lauri Alanko wrote:
> > ;   (cut <>)
> So this should not be an error, but should be expanded as (lambda (f)
> (f)).

I just have to add this, in case someone doubts whether the above form
would be useful to anyone. After having sent the above and returned back
to coding, I _immediately_ discovered a case where the non-restricted
cut comes useful:

(for-each (cut <>) thunks)

Now is that pretty or what? :)

The cut form works not only as a curry, but also as an applier, similar
to the ($) operator in Haskell. In Haskell, (map ($ x) funcs) is a
common idiom that has various uses, and it's nice to be able to do the
same with reasonably little syntactic overhead in Scheme as well. 


Posted on the users mailing list.