Block lambda is cool, its syntax isn't

Brendan Eich brendan at mozilla.com
Fri Jan 20 20:34:01 PST 2012


> Axel Rauschmayer <mailto:axel at rauschma.de>
> January 20, 2012 5:34 PM
>
> How much does the fact that a symbol *could* be used (in theory) 
> matter in practice? Most regexes I see for valid identifiers are still 
> of the ^[a-zA-Z_$][0-9a-zA-Z_$]*$ variety.
>
> I’d expect λ to be in use in Greece, but how about ƒ (which has been 
> mentioned many times)? It seems very appropriate and is even easy to 
> type on a Mac (easier than square brackets on a German keyboard!).

It's hard to type λ on many keyboards. ƒ is easier, but neither is 
backward-compatible:

js> ƒ = 1
1
js> ƒ
1
js> λ = 2
2
js> λ
2

We rejected these already for these reasons.

I think "use fn;" (real pragma syntax), with the low-precedence 
assignment-expression fn (params) assign-expr production, wins. What do 
you think?

/be
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20120120/5f22ab6e/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: postbox-contact.jpg
Type: image/jpeg
Size: 1222 bytes
Desc: not available
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20120120/5f22ab6e/attachment.jpg>


More information about the es-discuss mailing list