Concise functions, Nonexistent lambdas, Explicit tail calls

Michael Day mikeday at yeslogic.com
Tue Dec 9 14:42:37 PST 2008


Hi Jon,

> This will break existing code:
> http://www.google.com/codesearch?q=lang%3Ajavascript+%22var+fun%22&hl=en&btnG=Search+Code

As will "lambda":
http://www.google.com/codesearch?hl=en&lr=&q=lang%3Ajavascript+%22var+lambda%22&sbtn=Search

Or practically any other keyword we can think of. So this problem exists 
for many of the proposed syntactic extensions to JavaScript. Is there 
any way other than opt-in to introduce to new keywords without breaking 
existing code?

> The benefit seems vanishingly small.  I don't think it's enough to
> cover the (admittedly minor) cost in language complexity.

Mozilla already has expression comprehensions, albeit without the 
parentheses, so this aspect can be evaluated now.

>> Refraining from adding a new lambda construct will make JavaScript easier to
>> specify...
> 
> If you're right about this, I'd consider it a powerful argument
> against the lambda proposal.  It's not obvious, however.

Everything currently in the specification describing functions will 
still need to be there, even if some of it is rewritten to be expressed 
in terms of lambdas. On top of that, lambdas will need to be described. 
This will make the spec longer, and have more constructs that need to be 
understood. And I'm not convinced that describing functions in terms of 
lambdas makes them easier for implementors to understand than just 
describing their behaviour directly.

Best regards,

Michael

-- 
Print XML with Prince!
http://www.princexml.com


More information about the Es-discuss mailing list