'function *' is not mandatory

Jussi Kalliokoski jussi.kalliokoski at gmail.com
Sun Sep 1 05:38:29 PDT 2013


Sorry if this has been brought up before, but why `function *` (which looks
like a pointer to a function more than a generator) instead of something
clearer, e.g. `generator myGenerator () {}`? I see the obvious ASI hazard,
but this can be mitigated by not allowing unnamed generators, e.g. `{
myGenerator: generator _ () {} } `, which would not at least be worse than
the current syntax (star required, dummy identifier required, does it make
a difference?), but would be more descriptive. If you see something like
this for the first time, instead of going "wtf, pointer?!", you understand
that it is a generator, and if have no prior experience of generators in
other languages can google the concept.

If a more descriptive keyword sounds like a no-no (rationale appreciated),
please let's at least consider using a different operator than the star.

Cheers,
Jussi


On Sun, Sep 1, 2013 at 8:46 AM, François REMY <francois.remy.dev at outlook.com
> wrote:

> > > I've come to learn the TC39 committee members
> > > usually have good ideas even if they seem bad initially.
> > > I hope this is the case again this time...
> >
> > That is nice to hear, and quite a track record to live up to.
> > On behalf of all TC39 if I may, thanks.
>
> Well, I don't think I deserve such thanks just for stating my thrust in
> this group, but I can get how it must feel good to hear in the sea of
> complaints that you're probably used to receive ;-) It's the same story for
> any group, for what it's worth. People easily notice what's wrong, and
> consider all the goodness as granted. That's how humans are made, and how
> we progresses and avoids regression.
>
>
> > However, I cannot honestly leave you to expect this to
> > happen again in this case. I think we've stated the case
> > for "function*" as clearly as we're going to.
> >
> > It is a tradeoff.
>
> My gut tells me we're running out of such tradeoffs in JS at speed of
> light recently. There must be another way. And if such way exists, we shall
> find it.
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130901/85e092c0/attachment.html>


More information about the es-discuss mailing list