return when desugaring to closures

Mark S. Miller erights at google.com
Sun Oct 12 19:13:34 PDT 2008


2008/10/12 YR Chen <maian330 at gmail.com>:
> On Sun, Oct 12, 2008 at 7:34 PM, David-Sarah Hopwood
> <david.hopwood at industrial-designers.co.uk> wrote:
>>
>> So why are we arguing about whether lambdas should be allowed without
>> braces, when the direction being taken for the rest of the language
>> is to make the braces mandatory around all forms that can potentially
>> declare variables?
>
> What "rest of the language" are you talking about? |if|, |while|, and |for|
> do not require braces and thus do not necessarily create block scopes. I
> can't imagine a situation where |lambda(...) non_let_statement| would
> require creating a block scope for the lambda, unless that non_let_statement
> is a block itself.

David-Sarah said "that can potentially declare variables". If the then
branch of an |if| declares variables then it needs to be enclosed in
curlies in order to be a SubStatement.

-- 
    Cheers,
    --MarkM


More information about the Es-discuss mailing list