1 2 3 4 5 6 7 8 9 10 11 12
: compute-in-strand ( -- Int ) chan.make dup [ 10 5 i.* swap chan.send drop ] strand.spawn drop chan.receive drop # (channel value) nip # (value) ; : test-return-value ( -- ) compute-in-strand 50 test.assert-eq ;