March 28 meeting notes

Brendan Eich brendan at mozilla.org
Thu Mar 29 13:26:20 PDT 2012


Andreas Rossberg wrote:
> For me, the biggest blow against TCP lambda forms in general was 
> Mark's observation regarding the incompatibility with 'yield' that you 
> mention in the other post. 

It seems 'yield' may be a red herring. We all forgot that it is 
contextually defined as a keyword only in generator functions, which 
have a distinguished head (* after function or before method name).

Arrows cannot be generator functions, so yield is not reserved in arrow 
bodies. It need not be illegal, though. But probably it's best to ban 
just to avoid confusion:

function yield(e) { return 42; }

function* gen() {
   yield (v) => yield(v);
   yield 99;
}

The yield call after the =>, if not an error as the arrow function 
syntax proposal has it now, would call the outer yield function.

/be




More information about the es-discuss mailing list