Allen's lambda syntax proposal

David-Sarah Hopwood david.hopwood at
Sun Dec 7 06:45:48 PST 2008

Peter Michaux wrote:
> On Sat, Dec 6, 2008 at 7:51 PM, David-Sarah Hopwood
> <david.hopwood at> wrote:
>> The keyword 'function' shouldn't be used for this because a lambda is
>> not a function. However,
>>  const name(formals) ...
>>  let name(formals) ...
>> could be sugar for
>>  const name = lambda(formals) ...;
> Does "const" have "var" or "let" scoping...or is it even a declaration
> at all?

When 'let' and 'const' were proposed to be added to ES3.1, 'const' would
have been a declaration with the same scoping as 'let'. This part of the
ES3.1 proposal wasn't controversial, I think.

> Although it is bulky it might be better to write "const var"
> and "const let". A variable being constant or not is orthogonal to its
> scoping and should be controlled independently.

That would be the case if the scoping of 'let' wasn't a strict improvement
on, and intended replacement for, that of 'var'.

David-Sarah Hopwood

More information about the Es-discuss mailing list