Migrating from APL2 to Dyalog
2 posts
• Page 1 of 1
Migrating from APL2 to Dyalog
I wrote an article about this for Vector back in 1996.
So it's old, but I bet much of it is still relevant today.
https://www.rexswain.com/vector.pdf
So it's old, but I bet much of it is still relevant today.
https://www.rexswain.com/vector.pdf
- rex
- Posts: 12
- Joined: Sat Jun 10, 2023 10:49 pm
Re: Migrating from APL2 to Dyalog
From a quick read-through, it appears that many of the most severe issues have gone away over the years, or have viable work-arounds:
- There's no need to search for ⎕NC of the left argument to selectively insert braces around the left argument; just insert braces everywhere. Any monadic use of a strictly dyadic function would VALUE ERROR upon first usage of the left argument, just as APL2 would.
- While it is hard to identify uses of / as replicate vs reduce, a viable solution is to replace all instances with {⍺⍺/⍵} or {⍺⍺/[k]⍵} when used with an axis.
- You should probably use the Unicode version of Dyalog, which handles ⌻ ⍂ ⍸ ∵
- You can sink with {}
- (1 0 1/M[;4])←0 and (A⊃B)[I]←X work fine now.
- ,/⍳0 now returns ⊂⍳0 just like APL2.
- ⎕DL now handles fractional seconds.
- (X Y)←⊂'ABC' now behaves like APL2
- You can write your own ¨ that has APL2-like behaviour as Each←{⍺←⊢ ⋄ 0∊⍴¨⍺ ⍵ ⍵:⍺⊢¨⍵ ⋄ ⍺ ⍺⍺¨⍵} but note that it doesn't use the special fill function that corresponds to the operand.
- Dyalog now has ⌷.
- And n-wise reduction.
- And scalar function axis.
- And ⎕UCS
- )RESET does now allow an argument
-
Adam|Dyalog - Posts: 143
- Joined: Thu Jun 25, 2015 1:13 pm
2 posts
• Page 1 of 1
Return to Migrating from other Systems
Who is online
Users browsing this forum: No registered users and 1 guest
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group