We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
What about including Ocaml-style for cycle:
for i = 1 to 18 do ... done (or end)
It is very handy when iterating through arrays or strings. Also, it does not let one make common mistake with repeating calls in condition, like
for( i = 0; i < strlen(s); i++)
The text was updated successfully, but these errors were encountered:
It is not a very functional programming style to use loops. Why not just define a combinator?
fun foreach (lo, hi) f = let fun lp i = if (i <= hi) then (f i; lp(i+1)) else () in lp lo end
so you can write
foreach (1, 18) (fn i => ...)
If we are going to add syntax for loops, then I would be much more interested in list/vector comprehensions.
Sorry, something went wrong.
No branches or pull requests
What about including Ocaml-style for cycle:
for i = 1 to 18 do ... done (or end)
It is very handy when iterating through arrays or strings. Also, it does not
let one make common mistake with repeating calls in condition, like
for( i = 0; i < strlen(s); i++)
The text was updated successfully, but these errors were encountered: