Anonymous user
Loops/Continue: Difference between revisions
Added Oz example.
(pike) |
(Added Oz example.) |
||
Line 361:
v = sprintf("%s, ", v);
endfor</lang>
=={{header|Oz}}==
By using the "continue" feature of the for-loop, we bind C to a nullary procedure which, when invoked, immediately goes on to the next iteration of the loop.
<lang oz>for I in 1..10 continue:C do
{System.print I}
if I mod 5 == 0 then
{System.printInfo "\n"}
{C}
end
{System.printInfo ", "}
end</lang>
=={{header|Perl}}==
|