Handbook
Glossary
next* ( v gen -- result )
Generators
Prev:
take-all ( gen -- seq )
Next:
?next* ( v gen -- val/f end? )
Vocabulary
generators
Inputs
v
an
object
gen
a
generator
Outputs
result
an
object
Word description
Pass a value into the generator, resuming computation until a value is produced.
Definition
USING:
accessors
coroutines
kernel
;
IN:
generators
:
next*
( v gen -- result )
state>>
[
coresume
]
[
drop
stop-generator
]
if*
;