bug-apl
[Top][All Lists]
Advanced

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

Re: [Bug-apl] indexing of the array


From: Juergen Sauermann
Subject: Re: [Bug-apl] indexing of the array
Date: Sat, 05 Mar 2016 21:17:25 +0100
User-agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.4.0

Hi,

so Dyalog APL behaves differently than IBM APL2.
In such conflict cases GNU APL almost always follows IBM APL2.

/// Jürgen


On 03/05/2016 05:20 PM, Alexey Veretennikov wrote:
Hi,

I've just checked, Dyalog APL returns exactly what you are expecting
from it:

      2 a[1]
2
      b←⍳5
      9 8 b
9 8  1 2 3 4 5 
      9 8 b[2]
8
      

Elias Mårtenson <address@hidden> writes:

On 5 March 2016 at 19:12, Juergen Sauermann <address@hidden> wrote:


 Hi Alexey,

 the IBM APL2 binding rules say that [] binds stronger than vector notation (IBM APL2
 language reference page 34). That is, 

 100 200[1] is 100 (200[1])

 IBM APL2 behaves in the same way as GNU APL.


At first I was confused about this (and even started writing this email expressing that confusion). Then I
realised that it is Dyalog that must have a very bizarre evaluator.

What does the following do in Dyalog?

a ← 1
2 a[1]

If vector notation binds string that dereference, then this should return 2.

But if that is the case, what does the following return?

b ← ⍳5
9 8 b
9 8 b[2]

Again, if Dyalog is consistent, it should return 8, and not 9 8 2 which is the case in GNU APL.

However, if Dyalog returns the same value as GNU APL, that means that the parser changes the binding
strength depending on the type of arguments. That sounds incredibly weird to me.

Regards,
Elias


    


reply via email to

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