bug-apl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Question for the list...


From: Dr . Jürgen Sauermann
Subject: Re: Question for the list...
Date: Sat, 8 Aug 2020 15:36:35 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0

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

[Prev in Thread] Current Thread [Next in Thread]