Isolates: Calling functions in an isolate with an argument
Posted: Wed Mar 21, 2018 2:13 pm
I have a question about isolates and how to give an argument (a local variable) to a function, called in an isolate.
Here´s some code, I tried out:
iss←isolate.New¨'' '' '' ⍝ Make 3 isolates
t←iss.⎕DL 1 1 1 ⍝ Do 3 short delays
t←iss.(#.Version) ⍝ Call a niladic function Version
t←iss.(#.foo 99) ⍝ Call a monadic function foo with a
myLocVar←'abc' 'defg' 'hi' ⍝ simple argument for demo
iss.myVar←myLocVar ⍝ simple argument for demo
t←iss.(#.foo myVar) ⍝ works as expected
iss.(⎕ex'myVar')
⍝ Trying to call the monadic function "direct"
⍝ without defining and expunging variables in the isolates:
t←iss.(#.foo) myLocVar ⍝ FUTURE ERROR: 2: SYNTAX ERROR
What is the correct syntax for calling foo with the elements of myLocVar?
Here´s some code, I tried out:
iss←isolate.New¨'' '' '' ⍝ Make 3 isolates
t←iss.⎕DL 1 1 1 ⍝ Do 3 short delays
t←iss.(#.Version) ⍝ Call a niladic function Version
t←iss.(#.foo 99) ⍝ Call a monadic function foo with a
myLocVar←'abc' 'defg' 'hi' ⍝ simple argument for demo
iss.myVar←myLocVar ⍝ simple argument for demo
t←iss.(#.foo myVar) ⍝ works as expected
iss.(⎕ex'myVar')
⍝ Trying to call the monadic function "direct"
⍝ without defining and expunging variables in the isolates:
t←iss.(#.foo) myLocVar ⍝ FUTURE ERROR: 2: SYNTAX ERROR
What is the correct syntax for calling foo with the elements of myLocVar?