# Proposal - generator literals

**URL:** <https://es.discourse.group/t/proposal-generator-literals/693>\
**Category:** 💡 Ideas\
**Tags:** proposal, iterator-helpers\
**Created:** [March 12, 2021, 4:56am UTC](https://es.discourse.group/t/proposal-generator-literals/693 "2021-03-12T04:56:45Z")\
**Posts on this page:** 2\
**Page:** 2

<div class="post-metadata">

**Author:** ![MaxMotovilov](https://yyz2.discourse-cdn.com/free1/user_avatar/es.discourse.group/maxmotovilov/32/648_2.png) [@MaxMotovilov](https://es.discourse.group/u/MaxMotovilov)\
**Post date:** [July 11, 2021, 10:35pm UTC](https://es.discourse.group/t/proposal-generator-literals/693/21 "2021-07-11T22:35:57Z")

</div>

I have to admit that breaking off "long head" is a really ingenious solution and the packaging looks clean enough that I can't seem to come up with a way to break it...yet 😉 There is some added overhead from arrow-function wrapping but fixing `this` and `yield` is certainly worth it. The spurious overhead from `yield* [element]` instead of `yield element` is something else but can probably be also optimized away with extra effort. I'll think more along the lines of what else can be improved by static analysis if and when I get a chance.

Thanx again for pushing this forward!

---

<div class="post-metadata">

**Author:** ![lightmare](https://yyz2.discourse-cdn.com/free1/user_avatar/es.discourse.group/lightmare/32/843_2.png) [@lightmare](https://es.discourse.group/u/lightmare)\
**Post date:** [July 12, 2021, 10:35am UTC](https://es.discourse.group/t/proposal-generator-literals/693/22 "2021-07-12T10:35:53Z")

</div>

> [@MaxMotovilov](#):
>
> The spurious overhead from `yield* [element]` instead of `yield element` is something else but can probably be also optimized away with extra effort.

Yes, I pondered a few alternatives, but this one was very easy to implement, and good enough for the moment :)

While looking how to improve it, I found a more serious issue: my transform is shadowing some identifiers, so you can't do for example `*[kList]`.

Will post another PR fixing these.

[Previous page](https://es.discourse.group/t/proposal-generator-literals/693.md?page=1)
