Hi, Jürgen,
I hate to be augmentative, but what I'm seeing is:
)clear
CLEAR WS
SUM ← { ⍺ + ⍵⊣C←0 ;C;D }
⎕cr 'SUM'
λ←⍺ λ1 ⍵;C;D
λ← ⍺ + ⍵⊣C←0
6 SUM 7
13
)clear
CLEAR WS
SUM ← { ⍺ + ⍵⊣C←0 ;C;⎕io}
⎕cr 'SUM'
λ←⍺ λ1 ⍵;C;⎕io
λ← ⍺ + ⍵⊣C←0
6 SUM 7
VALUE ERROR
SUM[1] λ←⍺+⍵⊣C←0;C;⎕IO
^
But how about this: I'm looking into some stuff in libapl.so, so
while I'm doing that I'll look into the ⎕io thing.
--Chris
On 2020-08-08 09:36, Dr. Jürgen
Sauermann wrote:
Hi Chris,
I suspect that the syntax error is caused by assigning lll
twice and not ny localizing ⎕IO.
The first assignment (which most likely happened but is not
visible in your example) defines a function:
)clear
CLEAR WS
lll←{⍳⍵⊣⎕io←0;⎕io}
⎕CR 'lll'
λ←λ1 ⍵;⎕io
λ←⍳⍵⊣⎕io←0
At this point lll is a function and ⎕IO is a local variable of
it.
The second assigment raises a syntax error because vou try to
re-define lll
by assignment which is not allowed in GNU APL. BTW the same
error occurs
without localizing ⎕IO.
lll←{⍳⍵⊣⎕io←0;⎕io}
SYNTAX ERROR
lll←λ1
^ ^
Best Regards,
Jürgen
On 8/7/20 11:27 PM, Chris Moller
wrote:
I've just discovered that you get a syntax
error if you try to localise a system variable in a named
lambda:
lll←{⍳⍵⊣⎕io←0;⎕io}
lll 8
SYNTAX ERROR
lll[1] λ←⍳⍵⊣⎕IO←0;⎕IO
^ ^
Is it supposed to work that way? Or is that a bug?