March 28 meeting notes

Andreas Rossberg rossberg at
Thu Mar 29 12:16:59 PDT 2012

On 29 March 2012 20:35, Brendan Eich <brendan at> wrote:

> Andreas Rossberg wrote:
>  On 29 March 2012 16:11, Brendan Eich <brendan at <mailto:
>> brendan at>> 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:
> It did not seem to be headed for consensus and inclusion in
> harmony:proposals when we last discussed it.

Interesting. But this is different from what I had in mind. It is more like
a generalisation of 'break', while I was thinking of something like:

  function f(o) {
    o.forEach(function g(x) {
       if (...) return 0 from f;
       let x2 = h(y) {
         if (...) return from g
         return y*2  // returns from h
    return 27

That is, just a way for referring to the specific function (or arrow
function, if we had a syntax for naming them) that the return is supposed
to be associated with.

(I suppose Dave's proposal can encode that, but it would result in less
natural and significantly more verbose code.)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list