# Exercise: Spawning a Strand
#
# `strand.spawn` takes a quotation and runs it in a new strand.
#
# Stack effect: ( quot -- strand-id )
#
# The quotation runs concurrently. strand.spawn returns immediately
# with the strand's ID.
#
# Example:
#   [ "Hello from strand!" io.write-line ] strand.spawn
#   # Main continues while strand runs
#
# Your task: Spawn a strand that sends a value through a channel.
# When done, delete the marker line below.

# I AM NOT DONE

: test-basics ( -- )
    chan.make
    dup [ 42 swap chan.send drop ] strand.spawn
    drop   # Drop strand ID
    # Your code here — receive the value from the channel.
    # Remember that the receive operation returns the value
    # together with a status Bool, which you'll need to drop.
    drop
    0
    # Do not edit below this line
    42 test.assert-eq
;
