⍝ The following demonstrates message passing between an 'iota sever', ⍝ and a client (the user of the iota function). The client always initiates ⍝ communication, and the server must be running, but the client should not ⍝ be able to notice a difference between monadic ⍳ and the iota function, ⍝ even though one does the computation in a different thread. iotaServer←{ msg←1⍨⍇0 msg≡'stop': ⎕←'Bye bye from indexer' (from num)←msg _←(⍳num)⍈from ∇⍵ } id←0 ⍝ this is an invalid thread id, so it is a sane starting point start←{ id=0: iotaServer&⍬ id } stop←{ 'stop'⍈id } iota←{ ⍝ Sending messages to a nonexisting thread throws a domain error (11) 11::'Sorry, the iota server is not running' _←(⎕self ⍵)⍈id 1⍨⍇0 }