yield syntax (diverging from: How would shallow generators compose with lambda?)
Brendan Eich
brendan at mozilla.com
Sun May 17 13:11:06 PDT 2009
On May 17, 2009, at 12:43 PM, Mark S. Miller wrote:
> On Sun, May 17, 2009 at 11:00 AM, Brendan Eich <brendan at mozilla.com>
> wrote:
>> Analogous to direct vs. indirect eval in ES5 (15.1.2.1.1), there is
>> no
>> purely syntactic specification for what Neil proposes. A runtime
>> check is
>> required. So I don't see why you are focusing only on syntax here.
>
> I don't follow. What runtime check? For the eval operator, the runtime
> check is whether the value of the eval variable is the original global
> eval function. It makes no sense to have a corresponding global yield
> function value.
If we reserve yield then you're right. One of the appealing (at least
to me) aspects of Neil's suggestion was that it would avoid opt-in
versioning required by reserving yield (which is used in extant web
content, or was when we tried reserving it without opt-in versioning
-- the particular use was as a formal parameter name, used as a flag
not a function).
/be
More information about the es-discuss
mailing list