bug-apl
[Top][All Lists]
Advanced

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

Re: Disclose fails with mixed ranks


From: Elias Mårtenson
Subject: Re: Disclose fails with mixed ranks
Date: Thu, 23 Sep 2021 00:49:08 +0800

Well, for each element that has lower rank than the highest-rank element in the list should be rank-extended by prepending 1.

In other words, in the example I gave, the maximum rank (last element) is 2. The rank-1 element (the second one) should be extended to (1 2) by prepending 1.

Thus, the result from Dyalog is:

┌┌→──┐
↓↓3 0│
││0 0│
││   │
││1 2│
││0 0│
││   │
││0 1│
││2 3│
└└~──┘

The current implementation already extends scalars, so it seems to special-case that case anyway.

Regards,
Elias

On Wed, 22 Sept 2021 at 23:55, Louis Chretien via Bugs and suggestions for GNU APL <bug-apl@gnu.org> wrote:
And what is the correct answer?

I tried it with APL/X 5.1, and i get the same “RANK ERROR” as in GNU APL.

If i understand disclose correctly, the right argument are nested elements, but of a shape that allows for them to be laminated into a matrix as a result. Having a scalar, a vector and a matrix is bound to create difficulty.

On Sep 22, 2021, at 09:16, Elias Mårtenson <lokedhs@gmail.com> wrote:

The following _expression_ should work, if I'm reading the ISO spec correctly:

⊃ 3 (1 2) (2 2 ⍴ 0 1 2 3)

It does work on Dyalog, and gives the expected result.

Regards,
Elias


---
Louis Chrétien





reply via email to

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