Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flattening tail spread recursion #1

Merged

Conversation

lightmare
Copy link

@lightmare lightmare commented Jul 11, 2021

Q                       A
Fixed Issues?
Patch: Bug Fix?
Major: Breaking Change?
Minor: New Feature?
Tests Added + Pass? Yes
Documentation PR Link
Any Dependency Changes?
License MIT

edit: Perhaps important to note that I changed not just the implementation, but also some semantics. In particular, I wrap every expression in the list in an arrow function. Which has several effects:

// previously, this referred to the generator expression object,
let genMember = *[this.foo]; // lexical this with this PR

// previously, yield was allowed but produced really strange behaviour
let genYield = *[yield 5]; // illegal with this PR

Copy link
Owner

@MaxMotovilov MaxMotovilov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really ingenious solution with some extra overhead that can be partially undone with further refinement.

@MaxMotovilov MaxMotovilov merged commit 2977196 into MaxMotovilov:generator-literals Jul 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants