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 20:38:49 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0

Ji Chris,

I see. Have a look at SVN 1337.

Best Regards,
Jürgen


On 8/8/20 4:05 PM, Chris Moller wrote:
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?




reply via email to

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