[racket-dev] `cond' / `when' / `unless' / etc bodies

From: Eli Barzilay (eli at barzilay.org)
Date: Mon Oct 11 19:15:09 EDT 2010

6 hours ago, Neil Toronto wrote:
> Also, I could do
> 
>      (if <condition>
>          (begin (define ...) ...)
>          ...)
> 
> instead of the current (and very ugly)
> 
>      (if <condition>
>          (let ()
>            (define ...) ...)
>          ...)
> 
> which I've been doing a lot more now that I can mix internal
> definitions and expressions.

Yeah, that would be nice too.  I'm annoyed every time I use `(let ()
...)' just to get a new scope.  It just feels wrong in a similar way
that `xor EAX,EAX' is used to zero a register in intel.


> Would it break much? Would we end up needing a `#%plain-begin' and
> changing macros that search inner syntax for `begin'?

I'd love to see an implicit `#%begin', which could have the above
apply in more places automatically.  (It was one of the feature
requests I asked for in the summer meeting.)

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!


Posted on the dev mailing list.