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

for* generator expressions #505

Closed
edemaine opened this issue Apr 14, 2023 · 1 comment · Fixed by #1398
Closed

for* generator expressions #505

edemaine opened this issue Apr 14, 2023 · 1 comment · Fixed by #1398
Labels
proposal Proposal or discussion about a significant language feature

Comments

@edemaine
Copy link
Collaborator

We can make it easy for for to generate (yield) values instead of accumulating an array and returning it, given that we're already wrapping in an IIFE.

See jashkenas/coffeescript#5379 for this exact idea. I didn't think for* made sense in a CoffeeScript syntax, but it makes sense in Civet which inherits all of ECMAScript; I think it nicely pairs with the recently added async for. I'm also inspired here by Janet's generate.

@edemaine edemaine added the proposal Proposal or discussion about a significant language feature label Apr 14, 2023
@STRd6
Copy link
Contributor

STRd6 commented Apr 14, 2023

loop* and while* could also be cool for infinite generators.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proposal Proposal or discussion about a significant language feature
Projects
None yet
2 participants