Refer to Julia Doc , The General Cycle forin Julia:
for i = I # or "for i in I"
# body
end
while:
state = start(I)
while !done(I, state)
(i, state) = next(I, state)
end
, , , . , :
I=linspace(1, 10, 9)
state = start(I)
while !done(I, state)
(i, state) = next(I, state)
(j, _) = next(I, state)
println(i,' ',j)
end
1.0 2.125
2.125 3.25
3.25 4.375
4.375 5.5
5.5 6.625
6.625 7.75
7.75 8.875
8.875 10.0
10.0 11.125
< =