[racket] internal define in define

From: Carl Eastlund (cce at ccs.neu.edu)
Date: Wed Sep 21 04:52:18 EDT 2011

On Wed, Sep 21, 2011 at 4:24 AM, David Van Horn <dvanhorn at ccs.neu.edu> wrote:
> The grammar for define includes
>
>   (define id expr)
>
> but I wonder if this couldn't be relaxed to
>
>   (define id body)
>
> so that you could write things like
>
>   (define count
>     (define i 0)
>     (λ () (begin0 i (set! i (add1 i)))))
>
> David

+1

I have often wanted this.

--Carl



Posted on the users mailing list.