Disclose with Axis does not work as with APL2 !?
3 posts
• Page 1 of 1
Disclose with Axis does not work as with APL2 !?
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 ?
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: 7
- Joined: Wed Feb 15, 2012 10:55 am
- Location: Yvelines - France
Re: Disclose with Axis does not work as with APL2 !?
Hi Jean-Pierre,
Thanks for pointing this out; it does look strange.
We will investigate.
John.
Thanks for pointing this out; it does look strange.
We will investigate.
John.
- JohnS|Dyalog
Re: Disclose with Axis does not work as with APL2 !?
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:
Regards,
Jay.
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
3 posts
• Page 1 of 1
Return to Migrating from other Systems
Who is online
Users browsing this forum: No registered users and 0 guests
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group