summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorglenda <glenda@cirno>2022-09-09 22:05:58 +0000
committerglenda <glenda@cirno>2022-09-09 22:05:58 +0000
commit0f1552c7a132ed59160a930464e46b2a1a345fa5 (patch)
tree6a0d9192f56812872a5da6cc0f284d7f0b618c14
parentdcadd54d64d13dba04784df68570475e389187b7 (diff)
Add names to send and recv
-rw-r--r--tests/chain.apl13
1 files changed, 8 insertions, 5 deletions
diff --git a/tests/chain.apl b/tests/chain.apl
index b825bbb..62bc1a9 100644
--- a/tests/chain.apl
+++ b/tests/chain.apl
@@ -1,9 +1,12 @@
+send←⍈ ⍝ I can't type those easily so give them names
+recv←⍇
+
worker←{
- msg←{1 ⍵}⍇⍬
+ msg←{1 ⍵}recv ⍬
⍵≡⍬: ⎕←'DONE'
- ⎕←'Worker id ',(⍕⎕self),' got message: ',(⍕msg)
+ ⎕←'Worker id ',(⍕⎕self),' (',(⎕self ⎕tasks 1),') got message: ',(⍕msg)
⎕←'Forwarding from ',(⍕⎕self), ' to ',⍕⍵
- msg⍈⍵
+ msg send ⍵
}
-last←worker&⍣10⊢⍬
-'Hello there'⍈last
+last←worker&'worker'⍣10⊢⍬
+'Hello there' send last