Odd word problem/SimpleCoroutineSupportForJ: Difference between revisions
Odd word problem/SimpleCoroutineSupportForJ (view source)
Revision as of 15:45, 9 August 2012
, 11 years agobug fix (Aai emailed me both the problem and solution here)
mNo edit summary |
(bug fix (Aai emailed me both the problem and solution here)) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 8:
verb=. u
noun=. y
while. do. context=. verb noun
select. (0 {:: context) * 1+*#stack
case. 0 do. NB. yield
stack=. stack,
verb=. (
noun=.
case. 1 do. NB. return (with empty stack)
1 {:: context return.
Line 27 ⟶ 26:
)
NB. u yield v y return. NB. 0 -- deferred result,
yield=: 2 :0
0
)
NB. return y return. NB. 1 -- immediate result
return=: 3 :0
1; y
|