return when desugaring to closures

Mark S. Miller erights at google.com
Sat Oct 11 23:00:25 PDT 2008


On Sat, Oct 11, 2008 at 4:33 PM, Dave Herman <dherman at ccs.neu.edu> wrote:
>
>    Expression ::= ... | lambda Formals? Statement
>

Statement or SubStatement? If Statement, what meaning do you propose for

{
    const f = (lambda () const x = 3;);
    .... x ....
}

Does the const export its binding into the lambda's enclosing block,
such that the x on the next line refers to that x? I hope not.

If the answer is SubStatement, then changing the answer to Block in
order to require the curlies may very well help people understand the
scope relationships across the lambda boundary.

-- 
    Cheers,
    --MarkM


More information about the Es-discuss mailing list