Content deleted Content added
m Fix Linter errors. |
m →Icon: syntaxhighlight |
||
Line 74:
Printing squares from 0 to 20 can be achieved using a co-routine by writing:
<syntaxhighlight lang="icon">
local squares, j
squares := create (seq(0) ^ 2)
Line 82:
else
break
</syntaxhighlight>
However, most of the time custom generators are implemented with the "suspend" keyword which functions exactly like the "yield" keyword in CLU.
|