bug-apl
[Top][All Lists]
Advanced

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

Re: Issues with drop of a scalar argument


From: Dr . Jürgen Sauermann
Subject: Re: Issues with drop of a scalar argument
Date: Sat, 25 Apr 2020 16:02:01 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:60.0) Gecko/20100101 Thunderbird/60.6.1

Hi Kacper,

thanks, see below.

On 4/25/20 12:03 AM, Kacper Gutowski wrote:
1° With left argument longer than one, the scalar is properly extended to a higher rank one-element array, but then it's not dropped correctly unless all axes are non-zero.

      ⊢X← 1 0↓2
2
      ⍴X
1 1

The X here should be an empty array (0 1⍴0) but is (1 1⍴2).

Fixed in SVN 1271
2° When left argument has one non-zero element and right is a non-zero scalar, the returned result is a weird value that looks like the correct one (0⍴0), but is distinct, and isn't transferable.

      8⎕CR Y← 1↓1
┌⊖┐
│0│
└─┘
      ⍬≡Y ⍝ should be true
0
      (11⎕CR⍬)≡(11⎕CR Y)
1
      Y ≡ 12⎕CR 11⎕CR Y
0

Fixed in SVN 1271

3° This might not be an error, but I find it surprising:

      3 ≡ ''↓3  ⍝ this is correct
1
yes. But ISO has an example ''↓5 which looks the same.
      ''↓⍳3  ⍝ this is an extension (length error by ISO)
2 3
Fixed in SVN 1271. Now gives length error.
      ''↓⍳3 3
LENGTH ERROR
      ''↓⍳3 3
      ^  ^

Should be correct shape lengths are: left 0, right 2.
By my reading of ISO, when left argument is empty, the right must be a scalar (or it will be a length error) which is returned unchanged.  In Dyalog it's extended such that any value is returned unchanged, in GNU APL ⍬↓X ←→ 1↓X for non-scalar X.  Is this intended and correct?  (Is that what APL2 does?)

-k


The 2 ⎕TF looks slightly better now (your first example works, the second not).
I'll keep working on iy.

Bst regards,
Jürgen


reply via email to

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