Leading axis theory: Difference between revisions

Jump to navigation Jump to search
291 bytes added ,  13:52, 8 August 2021
HOPL citation for Whitney inventing Rank
No edit summary
(HOPL citation for Whitney inventing Rank)
(5 intermediate revisions by 2 users not shown)
Line 15: Line 15:
== Adoption in APL ==
== Adoption in APL ==


Because APL was designed before the leading axis model was developed, many APL primitives do not naturally adhere to the theory and some are not compatible with it at all. The following table describes how functions and operators that act on specific axes of their arguments (omitting for example [[Enclose]] and [[Match]] which apply to entire arrays) interact with leading axis theory.
Because APL was designed before the leading axis model was developed, many APL primitives do not naturally adhere to the theory and some are not [[compatible]] with it at all. The following table describes how functions and operators that act on specific axes of their arguments (omitting for example [[Enclose]] and [[Match]] which apply to entire arrays) interact with leading axis theory.


{|class=wikitable
{|class=wikitable
Line 33: Line 33:
|}
|}


Backwards-compatible language changes are only effective for functions which are extendible to leading axes. The following extensions have been made in order to support leading axis theory:
In addition to these, the [[Rank operator]] and [[scalar dyadic]]s can be extended with [[leading axis agreement]], so that arguments with different-length frames can match as long as one frame is a prefix of the other. The original introduction of Rank had only an analogue of [[scalar extension]], where an argument with an empty frame is repeated to pair it with an argument with a non-empty frame. The following extensions have been made in order to support leading axis theory:


{|class=wikitable
{|class=wikitable
Line 44: Line 44:
| [[Bracket indexing]]                    || {{No}}              || {{No}}              || {{Yes}}                        ||style="text-align:center;"| N/A  ||style="text-align:center;"| N/A
| [[Bracket indexing]]                    || {{No}}              || {{No}}              || {{Yes}}                        ||style="text-align:center;"| N/A  ||style="text-align:center;"| N/A
|-
|-
| [[Scalar dyadic]]s                      || {{Yes}}             || {{No}}              || {{No}}                        || {{Yes}}                        || {{Yes}}
| [[Scalar dyadic]]s                      || {{No}}             || {{No}}              || {{No}}                        || {{Yes}}                        || {{Yes}}
|-
|-
| [[Index Of]]                            || {{No|Incompatible}} || {{Yes|14.0}}        || {{Yes}}                        || {{Yes}}                        || {{Yes}}
| [[Index Of]]                            || {{No|Incompatible}} || {{Yes|14.0}}        || {{Yes}}                        || {{Yes}}                        || {{Yes}}
Line 55: Line 55:
|}
|}


[[Index Of]] in SHARP APL was not extended to apply to left argument [[major cell]]s as in J and Dyalog; instead it was given rank <source lang=apl inline>1 0</source> making such a change impossible. In A+ not only [[Index Of]] but also [[Membership]] was changed to follow the leading axis model, breaking compatibility with other APLs. A+ also restricts [[Take]] and [[Drop]] to allow only a [[singleton]] left argument (but any right argument rank is permitted). The leading-axis extension of scalar dyadics in SHARP is a direct consequence of giving them a function rank 0, as SHARP's concept of function rank includes [[prefix agreement]].
[[Index Of]] in SHARP APL was not extended to apply to left argument [[major cell]]s as in J and Dyalog; instead it was given rank <source lang=apl inline>1 0</source> making such a change impossible. In A+ not only [[Index Of]] but also [[Membership]] was changed to follow the leading axis model, breaking compatibility with other APLs. A+ also restricts [[Take]] and [[Drop]] to allow only a [[singleton]] left argument (but any right argument rank is permitted).


== History ==
== History ==


Leading axis theory was first developed by employees of [[I. P. Sharp Associates]] including [[Ken Iverson]], [[Arthur Whitney]], and [[Bob Bernecky]] in the early 1980s: the [[Rank operator]] itself is attributed to Whitney, who invented it while travelling to the [[APL82]] conference. It was further developed by Iverson and [[Roger Hui]] when creating the [[J]] language in the 1990s and 2000s; the leading axis model and its various incompatibilities with APL had been a major reason to break with APL and create a new language.
Leading axis theory was first developed by employees of [[I. P. Sharp Associates]] including [[Ken Iverson]], [[Arthur Whitney]], and [[Bob Bernecky]] in the early 1980s: the [[Rank operator]] itself is attributed to Whitney, who invented it while travelling to the [[APL82]] conference.<ref>[[Roger Hui]] and [[Morten Kromberg]]. [https://dl.acm.org/doi/abs/10.1145/3386319 ''APL since 1978'']. ACM [[HOPL]] IV. 2020-06.</ref> It was further developed by Iverson and [[Roger Hui]] when creating the [[J]] language in the 1990s and 2000s; the leading axis model and its various incompatibilities with APL had been a major reason to break with APL and create a new language.


Leading axis theory was brought to [[Nested array theory|nested]] APLs by [[Dyalog APL]] in the 2010s after [[Dyalog Ltd.]] employed Hui. Working with [[Jay Foad]] and [[Morten Kromberg]], Hui designed and implemented versions of Rank and other J functionality compatible with Dyalog's nested arrays.
Leading axis theory was brought to [[Nested array theory|nested]] APLs by [[Dyalog APL]] in the 2010s after [[Dyalog Ltd.]] employed Hui. Working with [[Jay Foad]] and [[Morten Kromberg]], Hui designed and implemented versions of Rank and other J functionality compatible with Dyalog's nested arrays.
== References ==
<references />


{{APL features}}[[Category:Leading axis theory| ]]
{{APL features}}[[Category:Leading axis theory| ]]

Navigation menu