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

iterators and iterator based for loops #2

Open
christianparpart opened this issue May 26, 2018 · 0 comments
Open

iterators and iterator based for loops #2

christianparpart opened this issue May 26, 2018 · 0 comments
Labels
enhancement New feature or request

Comments

@christianparpart
Copy link
Owner

christianparpart commented May 26, 2018

implement iterator based for loops

code example

def range(int n) : iterator<int> {
  var i = 0;
  while i < n {
    yield i;
    i = i + 1;
  }
}

main {
  for n in range(5) {
    print(string(n));
  }
}
# prints 5 lines with the numbers 0 to 4.
@christianparpart christianparpart added the enhancement New feature or request label May 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant