Handbook
Glossary
coyield ( v -- result )
Vocabulary
coroutines
Inputs
v
an
object
Outputs
result
an
object
Word description
Suspend the current coroutine, leaving the value v on the stack when control is passed to the
coresume
caller. When this coroutine is later resumed, result will contain the value passed to
coyield
.
See also
*coyield
,
coyield*
,
coterminate
Definition
USING:
accessors
continuations
kernel
namespaces
;
IN:
coroutines
:
coyield
( v -- result )
current-coro
get
[
[
continue-with
]
curry
>>resumecc
exitcc>>
continue-with
]
callcc1
2nip
;