Closed ghost closed 3 years ago
Hi @cpsquonk, I have had the same issue. What I ended up doing was using an if
statement instead of the continue
:
@resumable function f()
for i in 1:10
if i % 2 != 0
@yield i
end
end
end
Hi
The for
iterator loop is transformed into a while
loop. The update of the iterator is done just before the end
keyword of the loop ... so continue
skips the update and the iterator does not advance...
I suppose that continue
is replaced by a local jump. Something similar has to be implemented.
I keep you informed of possible progress
Kind regards
Ben
I had a really productive evening;) This should work now! Feedback is welcome!
The following hangs:
Adding a line to print out
i
shows that the loop goes through once withi = 1
, then repeats the loop body forever withi = 2
.