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: Jay Foad
Subject: Re: Issues with drop of a scalar argument
Date: Mon, 27 Apr 2020 08:39:38 +0100

In Dyalog this is part of a consistent extension whereby you're allowed to use a "short left argument" to Take and Drop (and Squad). For example 3↑mat returns the first 3 rows of mat, and 3↓mat removes the first 3 rows.

https://help.dyalog.com/13.0/index.html?page=html%2Frelnotes13.0%2Fv13.0%20takedropindex.htm

Jay.

On Fri, 24 Apr 2020 at 23:03, Kacper Gutowski <address@hidden> wrote:
3° This might not be an error, but I find it surprising:

       3 ≡ ''↓3  ⍝ this is correct
1
       ''↓⍳3  ⍝ this is an extension (length error by ISO)
2 3
       ''↓⍳3 3
LENGTH ERROR
       ''↓⍳3 3
       ^  ^

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?)


reply via email to

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