'function *' is not mandatory

Brendan Eich brendan at mozilla.com
Sat Aug 31 17:54:45 PDT 2013


Brendan Eich wrote:
>>    A GeneratorFunction's body is evaluated sometime after its call 
>> returns.
>
> This is ill-stated. You mean a continuation of a yield in its body is 
> evaluated, not the whole body (re-)evaluated.
>
> Of course, there may be no yield, or the yield may not be reached. 
> Yuichi pointed out similarity with return. 

Sorry, now I get to be tough with myself: your "its call" threw me, my 
mistake. I was thinking a call to g.next() given g = gen() for a 
generator named gen. But diagramming the sentence, you mean the call 
gen(), and your statement is well-stated.

/be


More information about the es-discuss mailing list