[racket] "lab notebook on learning process" (was: Re: Macros baffle me)

From: Sam Tobin-Hochstadt (samth at cs.indiana.edu)
Date: Tue May 6 19:30:14 EDT 2014

On Tue, May 6, 2014 at 7:23 PM, Gustavo Massaccesi <gustavo at oma.org.ar> wrote:
>>> > He wants an Arc-style lambda function. Hmph.
>
>>> Does it mean that I'll get an Arc-style lambda function eventually, or that
>>> I'll get an explanation why it's a bad ide— wait, nevermind, I can get
>>> whatever I want, 'cause it's Racket. Mwa-ha-ha.
>
>>> (I'd still welcome an explanation, tho.)
>
>>I don't think saving key strokes in Arc-style fashion is good for
>>the future reader of my software. But go ahead and re-create the
>>syntax or borrow it from the Arc implementation (which is some
>>large Racket macro).
>
> In Arc the shorthand for lambdas like [* _ 2] is implemented as a
> short readtable extension in MzScheme. It expands [* _ 2] to (fn (_)
> (* _ 2)) at read time, and this is interpreted as Arc code. (It’s only
> 15 lines of code and most of the code is boilerplate.)

I've implemented a similar thing in a somewhat-more-integrated manner
here: https://github.com/samth/fancy-app

My goal was to behave like Scala. I don't use this much, but I wish
for it often. :)

Sam


Posted on the users mailing list.