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

Generators #100

Open
katsaii opened this issue Sep 22, 2023 · 0 comments
Open

Generators #100

katsaii opened this issue Sep 22, 2023 · 0 comments
Assignees
Labels
enhancement New feature or request high priority Important syntax Related to the syntax of the language

Comments

@katsaii
Copy link
Owner

katsaii commented Sep 22, 2023

What is your feature request?

Implement generators through a yield keyword.

Please describe in detail how you expect this new feature to behave.

Catspeak code:

countdown = fun () {
  yield 1
  yield 2
  yield 3
}

GML code:

var counter = f.globals.countdown();

show_message(counter()); // 1
show_message(counter()); // 2
show_message(counter()); // 3
show_message(counter()); // undefined(?)
show_message(counter()); // undefined(?)
@katsaii katsaii added the enhancement New feature or request label Sep 22, 2023
@katsaii katsaii self-assigned this Sep 22, 2023
@katsaii katsaii added high priority Important syntax Related to the syntax of the language labels Sep 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request high priority Important syntax Related to the syntax of the language
Projects
None yet
Development

No branches or pull requests

1 participant