Andreas Rossberg wrote:
On 29 March 2012 16:11, Brendan Eich <[email protected] <mailto:[email protected]>> wrote:

    Yesterday, Luke made a stronger point: TCP 'return' means async
    callbacks (e.g. promise when functions) must be written ML-style,
    with return value in tail position. Callbacks can be lengthy, so
    writing and if-else nest with a variable holding the r.v. to
    achieve this is awkward and users will prefer early returns (so
    the calllback's spine is the normal execution path). But TCP will
    make these wrong-return bugs.


I actually think this is a less severe problem. Ignoring the issue of potential confusion for users (which is real), the main thing lacking there in terms of expressiveness is some labelled variant of 'return', analogous to break and continue. If we were so inclined, I'm sure we could come up with something usable on that front.

Dave did:

http://wiki.ecmascript.org/doku.php?id=strawman:return_to_label

It did not seem to be headed for consensus and inclusion in harmony:proposals when we last discussed it.

/be
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to