bug-apl
[Top][All Lists]
Advanced

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

Re: [Bug-apl] Format returns wrong rank


From: Blake McBride
Subject: Re: [Bug-apl] Format returns wrong rank
Date: Sun, 25 May 2014 12:59:58 -0500

Thanks.  I discovered the issue when porting over some of my old code.  The use-case was very clear which is correct.  I had a character matrix (test).  The function appended line numbers by concatenating ⍳1↑⍴matrix.  It worked in all cases except of the matrix had one line.  Clearly a person is not supposed to execute online of APL code in the case of a one line matrix vs. any other number of lines.  You correction will make the code work in all cases - like it used to.

Thanks.

Blake



On Sun, May 25, 2014 at 11:35 AM, Juergen Sauermann <address@hidden> wrote:
Hi Blake,

thanks, fixed in SVN 290.

As far as ⍕ is concerned there seems to be no right or wrong.

The IBM APL2 language reference contradicts itself (e.g. pages 135 vs. 136 for nested values)
and the ISO standard always wants a result rank ≥ 2 while IBM sometimes gives rank = 1.

I have tried my best to make sense out of that.

My approach was even different (rank 1 for one-line output and rank 2 otherwise) but now
it should be a little closer to IBM APL2.

/// Jürgen



On 05/25/2014 01:20 AM, Blake McBride wrote:
      ⍴⍕,5
1
      ⍴⍕2 1⍴5
2 1
      ⍴⍕1 1⍴5
1

The final result should have been:
1 1

Blake




reply via email to

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