Disclose with Axis does not work as with APL2 !?

How to move APL code to Dyalog

Disclose with Axis does not work as with APL2 !?

Postby Jean-Pierre on Tue Feb 26, 2013 12:15 pm

hello
I noticed this anomaly for some time, I finally decided to share it with you

the definitions of "Disclose with Axis" are :

>>> with Dyalog (Mix with ⎕ML≥2) :
K is an optional axis specification
The value of K must be a fractional number indicating the two axes of Y
between which new axes are to be inserted.

>>> with APL2 : (APL2 Programming : Language Reference pages 96-99)
X defines the axes of Z,into which items of R are structured.
X: Simple scalar or vector, nonnegative integers

Z←2 4⍴'PA' 'MA' 'WE' 'BY' 'IT' 'UP' 'ON' 'HI'
⍴R←(2 4⍴⍳8) (2 4⍴'ABCDEFGH') (Z)
3
⍴¨R
2 4 2 4 2 4

⍴⊃[1 2]R
LENGTH ERROR ======> may be : 2 4 3

but, we have the same result with :
⍴⊃[.5]R
2 4 3

⍴⊃[2 3]R
LENGTH ERROR ======> may be : 3 2 4

same result with :
⍴⊃[1.5]R
3 2 4

⍴⊃[1 3]R ======> may be : 2 3 4 ====> not possible with Dyalog ?

in the the same way, the order of the axes can not be changed as shown on page 98

is that this difference in operation is voluntary on your part?
it is noticeable it might be possible to coexist both modes, since we have:
Dyalog : ".... a fractional number ...."
APL2 : "....... integers"

is that this improvement is possible ?
Jean-Pierre
 
Posts: 6
Joined: Wed Feb 15, 2012 10:55 am
Location: Yvelines - France

Re: Disclose with Axis does not work as with APL2 !?

Postby JohnS|Dyalog on Wed Feb 27, 2013 12:40 pm

Hi Jean-Pierre,
Thanks for pointing this out; it does look strange.
We will investigate.
John.
User avatar
JohnS|Dyalog
 
Posts: 173
Joined: Wed Sep 10, 2008 10:01 am

Re: Disclose with Axis does not work as with APL2 !?

Postby Jay|Dyalog on Thu Mar 21, 2013 8:56 am

Hi Jean-Pierre,

Thank you for this suggestion. I have now implemented the full APL2 behaviour of disclose-with-axis, and it will be available in Dyalog APL Version 14.0 (scheduled for release in 2014).

This is how your examples work in a Dyalog V14 session with ⎕ML≥2:

Code: Select all
      Z←2 4⍴'PA' 'MA' 'WE' 'BY' 'IT' 'UP' 'ON' 'HI'
      ⍴R←(2 4⍴⍳8) (2 4⍴'ABCDEFGH') (Z)
3
      ⍴¨R
 2 4  2 4  2 4
      ⍴⊃[1 2]R
2 4 3
      ⍴⊃[2 3]R
3 2 4
      ⍴⊃[1 3]R
2 3 4

Regards,
Jay.
Jay|Dyalog
 
Posts: 16
Joined: Mon Aug 09, 2010 10:45 am


Return to Migrating from other Systems

Who is online

Users browsing this forum: No registered users and 1 guest