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?

Reply via email to