In Julia, when looping through an iterable object I is done with the for syntax:
for i = I # or "for i in I"
# body
end
Behind the scenes, this is translated to:
state = start(I)
while !done(I, state)
(i, state) = next(I, state)
# body
end
Therefore, if you wan...