[racket-dev] Fancy application/automatic anonymous functions

From: Jay McCarthy (jay.mccarthy at gmail.com)
Date: Tue May 17 15:33:44 EDT 2011

Obviously, I prefer super-cut, but this is still cute. :)


2011/5/17 Sam Tobin-Hochstadt <samth at ccs.neu.edu>:
> Scala has the nice feature that if you write something like this:
>  lst.map(_ - 1)
> It automatically rewrites to a function like this:
>  lst.map(x => x - 1)
> This makes writing some higher-order functions much easier.
> Of course, it's easy to make this using a macro and `#%app'.  You can
> see the result here:
>  github.com/samth/fancy-app
> I'm planning to put this in `unstable/app', and if there's interest
> I'll think about incorporating it into the default `#%app', after some
> experience with it.
> Lots of people have written similar things (`cut' in SRFI 26, Jay's
> `super-cut', etc), but I'd like to move towards using it implicitly.
> --
> sam th
> samth at ccs.neu.edu
> _________________________________________________
>  For list-related administrative tasks:
>  http://lists.racket-lang.org/listinfo/dev

Jay McCarthy <jay at cs.byu.edu>
Assistant Professor / Brigham Young University

"The glory of God is Intelligence" - D&C 93

Posted on the dev mailing list.