2011/3/29 Bob Nystrom <[email protected]>:
> Wouldn't => work the same way?
>     (a, b) =>
> It parses "(a, b)" thinking it's a grouped comma operator (not exactly a
> common expression FWIW), then it hits "=>" realizes it's a function
> parameter decl, and then either backtracks or just transforms the left-hand
> AST into a param decl.

An AST won't cut it.  You have to use a parse tree because there are
valid grouped comma operators containing only identifier operands that
are not valid parameter lists, e.g. ((a), b)

Once you do have a way to make the necessary distinctions, => is just
another right associative operator that you need to pick a precedence
for.
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to