Odd word problem/SimpleCoroutineSupportForJ: Difference between revisions

bug 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
context=. verb noun
select. (0 {:: context) * 1+*#stack
case. 0 do. NB. yield
stack=. stack, 21 { context
verb=. (32 { context)`:0
noun=. 13 {:: context
case. 1 do. NB. return (with empty stack)
1 {:: context return.
Line 27 ⟶ 26:
)
 
NB. u yield v y return. NB. 0 -- deferred result, 0will be executing: u v y
yield=: 2 :0
0; y; u ` v,< y
)
 
NB. return y return. NB. 1 -- immediate result 1: y
return=: 3 :0
1; y
6,962

edits