Isaac Schlueter wrote:
I'd suggest dropping the

    Identifier_opt ( FormalParameterList_opt ) [no LineTerminator here]
IniitialValue

production.  Wouldn't that mean that you could have something like this?

     var allA = list.map(() "a")

I think the curly braces are ok here.  Hated keywords should be
attacked one at a time, imo.

Divide-and-conquer in language design can go down many bad paths. One is that if we attack 'return' naively, we make a completion-value leak hazard (discussed many times on this list).

Block-lambda revival uses a different-looking syntactic special form to call out the places where TCP holds and return means the same in the body as in the enclosing function.

For what we're discussing here, no such TCP should be contemplated (you'll be relieved to hear :-P). That means we can't just say "curly braces and impute the return value from the completion value", though -- not without facing the dilemma of unintended completion value leaks. There's no a-priori solution to this dilemma.

Thus my interest in a low-precedence expression-bodied alternative syntax for short functions.

/be

_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to