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

From: Neil Toronto (neil.toronto at gmail.com)
Date: Mon Oct 11 12:59:34 EDT 2010

If I get a vote, +1/2 from me.

My vote isn't +1 because I'd rather see a syntactic restriction removed: 
make the inside of a `begin' an internal definition context. Then the 
change would happen in every similar macro at once.

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.

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

Neil T

Jos Koot wrote:
>  
> +1,
> In macro definitions that produce code with bodies, I almost by routine
> write (let () etc ...)
> There may be a problem including the bodies of begin forms, for they may be
> lifted out.
> Jos
> 
>> -----Original Message-----
>> From: dev-bounces at racket-lang.org 
>> [mailto:dev-bounces at racket-lang.org] On Behalf Of Jay McCarthy
>> Sent: 10 October 2010 22:28
>> To: Matthias Felleisen
>> Cc: dev at racket-lang.org
>> Subject: Re: [racket-dev] `cond' / `when' / `unless' / etc bodies
>>
>> Ditto.
>>
>> On Sun, Oct 10, 2010 at 1:36 PM, Matthias Felleisen 
>> <matthias at ccs.neu.edu> wrote:
>>> On Oct 10, 2010, at 2:43 PM, Robby Findler wrote:
>>>
>>>> I too am in favor of when, unless, and cond being 
>> definition contexts.
>>> +1.
>>>
>>> I routinely wrap cond/when in let () for just that purpose.
>>> _________________________________________________
>>>  For list-related administrative tasks:
>>>  http://lists.racket-lang.org/listinfo/dev
>>>
>>
>>
>> --
>> Jay McCarthy <jay at cs.byu.edu>
>> Assistant Professor / Brigham Young University 
>> http://teammccarthy.org/jay
>>
>> "The glory of God is Intelligence" - D&C 93 
>> _________________________________________________
>>   For list-related administrative tasks:
>>   http://lists.racket-lang.org/listinfo/dev
> 
> 
> _________________________________________________
>   For list-related administrative tasks:
>   http://lists.racket-lang.org/listinfo/dev



Posted on the dev mailing list.