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

parse for statements #10

Closed
degory opened this issue Jul 14, 2017 · 0 comments
Closed

parse for statements #10

degory opened this issue Jul 14, 2017 · 0 comments
Assignees

Comments

@degory
Copy link
Owner

degory commented Jul 14, 2017

statement will be a foreach, i.e. new syntax

for i in 0..9 do
    IO.Std.err.println("blah");
od

is equivalent to old L syntax

foreach var i; 0..9 do
    IO.Std.err.println("blah");
od

Note

  • No explicit var - loop variable is auto-declared let, scoped to body of loop
  • If concerned about efficiency, could recognise range constructor as a special case.
  • Either no support for C style for, or differentiate it by presence of semicolons
@degory degory added this to the parser complete milestone Jul 14, 2017
@degory degory self-assigned this Jul 14, 2017
degory added a commit that referenced this issue Jul 18, 2017
@degory degory closed this as completed Jul 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant