Loops/While: Difference between revisions

Line 2,196:
2
1</pre>
 
The following also works, and shows a way to avoid having to code the method of writing the output into the loop itself.
<lang objecticon>import io
 
procedure main()
local coexpression
coexpression := create generator(1024)
while write(@coexpression)
end
 
procedure generator(n)
while 0 < n do { suspend n; n /:= 2 }
end</lang>
 
=={{header|OCaml}}==
1,448

edits