Mix: Difference between revisions

Jump to navigation Jump to search
m (Text replacement - "<source" to "<syntaxhighlight")
(SHARP eventually extended Disclose to pad like J does now)
Line 35: Line 35:
[[APL2]], released in 1984, used the same name Disclose as SHARP APL but introduced the glyph [[Right Shoe]] (<syntaxhighlight lang=apl inline>⊃</syntaxhighlight>). It shared NARS's [[function axis]] definition, but extended the function to allow argument elements with different [[shape]]s as long as they had the same [[rank]]. Arrays with different shapes would be padded using [[fill element]]s as with [[Take]] to bring them to a common shape large enough to contain every element.
[[APL2]], released in 1984, used the same name Disclose as SHARP APL but introduced the glyph [[Right Shoe]] (<syntaxhighlight lang=apl inline>⊃</syntaxhighlight>). It shared NARS's [[function axis]] definition, but extended the function to allow argument elements with different [[shape]]s as long as they had the same [[rank]]. Arrays with different shapes would be padded using [[fill element]]s as with [[Take]] to bring them to a common shape large enough to contain every element.


A further extension was introduced as a consequence of [[J]]'s definition of the [[Rank operator]]. In J, result arrays in a function applied with rank can have different [[rank]]s, and results with lower rank are brought to a common rank by adding leading 1s to the shape. This change was taken up by [[Dyalog APL]] in [[Dyalog APL 14.0|version 14.0]], which introduced [[Rank (operator)|Rank]] following J's definition, in order to make Mix and Rank consistent. However, Dyalog differs from J in that it permits [[mixed array]]s, so while in J an array containing a mix of numbers, characters, and boxes cannot be mixed, in Dyalog any array at all can be mixed.
A further extension was added to SHARP APL in 1989,<ref>[[IPSA]]. [https://archive.org/details/sharp-apl-release-20.0-guide-for-apl-programmers "SHARP APL Release 20.0: Guide for APL Programmers"].</ref> and featured in [[J]] as a consequence of its definition of the [[Rank operator]]. In J, result arrays in a function applied with rank can have different [[rank]]s, and results with lower rank are brought to a common rank by adding leading 1s to the shape. This change was taken up by [[Dyalog APL]] in [[Dyalog APL 14.0|version 14.0]], which introduced [[Rank (operator)|Rank]] following J's definition, in order to make Mix and Rank consistent. However, Dyalog differs from J in that it permits [[mixed array]]s, so while in J an array containing a mix of numbers, characters, and boxes cannot be mixed, in Dyalog any array at all can be mixed.


== Language support ==
== Language support ==
Line 46: Line 46:
| [[NARS]]                        || Mix      || <code>↑</code> || [[Shape]]          || {{Yes}} || {{No}}
| [[NARS]]                        || Mix      || <code>↑</code> || [[Shape]]          || {{Yes}} || {{No}}
|-
|-
| [[SHARP APL]], [[A+]]           || Disclose || <code>></code> || [[Shape]] and type || {{No}}  || {{No}}
| [[A+]], SHARP <19.0              || Disclose || <code>></code> || [[Shape]] and type || {{No}}  || {{No}}
|-
| [[SHARP APL]]                    || Disclose || <code>></code> || Type              || {{No}}  || {{No}}
|-
|-
| [[APL2]], [[APLX]]              || Disclose || <code>⊃</code> || [[Rank]]          || {{No}}  || {{Yes}}
| [[APL2]], [[APLX]]              || Disclose || <code>⊃</code> || [[Rank]]          || {{No}}  || {{Yes}}
Retrieved from ‘https://aplwiki.com/wiki/Mix