Generators with arrow functions.

# Hemanth H.M (11 years ago)

Is there a mention about it somewhere?

Something like:

gen = (x) * => yield x+2;

I understand that arrow functions are lexically bound and has an explicitly return in it's a one liner.

# Jeremy Martin (11 years ago)

This has come up a few times. Check out this thread, for example: esdiscuss.org/topic/generator-arrow-functions.

# Hemanth H.M (11 years ago)

It is one proposed syntax for async functions.

Cool, thanks.

# Brendan Eich (11 years ago)

Hemanth H.M wrote:

It is one proposed syntax for async functions.

Cool, thanks.

Not sure who wrote the >-cited line -- Jeremy didn't.

On Tue, Sep 23, 2014 at 7:30 PM, Jeremy Martin <jmar777 at gmail.com <mailto:jmar777 at gmail.com>> wrote:

This has come up a few times.  Check out this thread, for example:
http://esdiscuss.org/topic/generator-arrow-functions.

Jeremy makes a good point, which would help reduce noise on the list if everyone grokked it. Check esdiscuss.org (use site:esdiscuss.org search with keywords) before posting. Several threads lately would have been avoided by the original poster doing this and finding the answer.

It's sometimes hard to find with a quick search -- you may need to look around and refine your search. We surely could use a consolidated rationale document for the many design decisions in ES6. But we have a resource in esdiscuss.org, which can help cut down on noise.

# Hemanth H.M (11 years ago)

I normally do it, today out of excitement did a mistake, sorry for that!

# Alex Kocharin (11 years ago)

23.09.2014, 18:22, "Brendan Eich" <brendan at mozilla.org>:

Hemanth H.M wrote:

It is one proposed syntax for async functions.  Cool, thanks.

Not sure who wrote the >-cited line -- Jeremy didn't.

It was written by Erik Arvidsson 10 months ago in the thread Jeremy linked to.