-
Notifications
You must be signed in to change notification settings - Fork 9
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
continue
within @tasks
#95
Comments
|
Yeah continue works for |
julia> @tasks for i ∈ 1:10
if isodd(i)
return
end
println(i)
end
8
2
6
4
10 |
I guess the question is whether we should replace |
I'd lean towards no, because I don't want to be responsible for correctly parsing and understanding arbitrary user code. e.g. if they write
then we'd actually want to leave that use of
The way Transducers does it is if one task signals that it encountered the early termination signal, then it basically just abandons the other tasks and never |
I've added a documentation label because we should at least mention this ( |
I've created a new issue for early termination support (e.g. |
Another potential way to support julia> @tasks for i in 1:4
for i in i # trivial loop to support continue (could be auto inserted)
if i > 2
continue
end
println(i)
end
end
2
1
julia> tforeach(1:4) do i
for i in i # trivial loop to support continue (could be auto inserted)
if i > 2
continue
end
println(i)
end
end
2
1 |
can we insert |
I think this should be fine, but I guess the
@tasks
transformation made the Julia parsers unhappy:The text was updated successfully, but these errors were encountered: