Take: Difference between revisions

Jump to navigation Jump to search
366 bytes added ,  16:28, 17 March 2020
→‎History: NARS2000 adopted the SHARP extension between 2017 and 2019
(→‎History: NARS2000 adopted the SHARP extension between 2017 and 2019)
Line 105: Line 105:
== History ==
== History ==


In [[A Programming Language]], [[prefix]] and [[suffix]] operations were described using the syntax <math>\alpha^j/x</math> to take the first <math>j</math> elements of vector <math>x</math> and <math>\omega^j/x</math> for the last <math>j</math> elements. This combined a use of the special prefix and suffix vectors <math>\alpha^j(n)</math> and <math>\omega^j(n)</math> with [[Compress|compression]], with the length <math>n</math> inferred based on the length of <math>x</math>. The symbol <math>\uparrow</math> was used for vector [[Rotate]], while <math>\downarrow</math> rotated in the opposite direction.<ref>Iverson, K.E. (1962). A Programming Language. Wiley. ISBN 978-0-471-43014-8.</ref>
In [[A Programming Language]], [[prefix]] and [[suffix]] operations were described using the syntax <math>\alpha^j/x</math> to take the first <math>j</math> elements of vector <math>x</math> and <math>\omega^j/x</math> for the last <math>j</math> elements. This combined a use of the special prefix and suffix vectors <math>\alpha^j(n)</math> and <math>\omega^j(n)</math> with [[Compress|compression]], with the length <math>n</math> inferred based on the length of <math>x</math>. The symbol <math>\uparrow</math> was used for vector [[Rotate]], while <math>\downarrow</math> rotated in the opposite direction.<ref>[[Ken Iverson|Iverson, K.E.]] (1962). A Programming Language. Wiley. ISBN 978-0-471-43014-8.</ref>


The first version of [[APL\360]]<ref>Falkoff, A.D., and K.E. Iverson. [https://www.jsoftware.com/papers/APL360TerminalSystem.htm "The APL\360 Terminal System"]. Research Report RC-1922, IBM, 1967-10-16.</ref> followed Iverson notation in defining prefix (<source lang=apl inline>n ⍺ j</source>) and suffix (<source lang=apl inline>n ⍵ j</source>) vectors but not Take, even though the arrow symbols were no longer used for Rotate. For a vector <source lang=apl inline>x</source>, what is now <source lang=apl inline>j↑x</source> would have been written <source lang=apl inline>((⍴x)⍺j)/x</source> while <source lang=apl inline>(-j)↑x</source> would be <source lang=apl inline>((⍴x)⍵j)/x</source>. The functions Take and Drop using arrow symbols were introduced by 1968<ref>Falkoff, A.D., and K.E. Iverson, "[http://keiapl.org/archive/APL360_UsersMan_Aug1968.pdf APL\360 User's Manual]". IBM, August 1968.</ref>.
The first version of [[APL\360]]<ref>[[Adin Falkoff|Falkoff, A.D.]], and [[Ken Iverson|K.E. Iverson]]. [https://www.jsoftware.com/papers/APL360TerminalSystem.htm "The APL\360 Terminal System"]. Research Report RC-1922, IBM, 1967-10-16.</ref> followed Iverson notation in defining prefix (<source lang=apl inline>n ⍺ j</source>) and suffix (<source lang=apl inline>n ⍵ j</source>) vectors but not Take, even though the arrow symbols were no longer used for Rotate. For a vector <source lang=apl inline>x</source>, what is now <source lang=apl inline>j↑x</source> would have been written <source lang=apl inline>((⍴x)⍺j)/x</source> while <source lang=apl inline>(-j)↑x</source> would be <source lang=apl inline>((⍴x)⍵j)/x</source>. The functions Take and Drop using arrow symbols were introduced by 1968<ref>[[Adin Falkoff|Falkoff, A.D.]], and [[Ken Iverson|K.E. Iverson]], "[http://keiapl.org/archive/APL360_UsersMan_Aug1968.pdf APL\360 User's Manual]". [[IBM]], August 1968.</ref>.


The [[Function axis|axis]] specification for Take was defined in [[APL2]]. It is shared by [[SHARP APL]] and [[Rationalized APL]], and continues to be supported in [[Dyalog APL]].
The [[Function axis|axis]] specification for Take was defined in [[APL2]]. It is shared by [[SHARP APL]] and [[Rationalized APL]], and continues to be supported in [[Dyalog APL]].


[[SHARP APL]] 19.0, released in 1987, extended Take to allow short left arguments. The choice to align left argument elements with the leading axes of the right argument was made according to the nascent [[leading axis theory]]: while a user may not have any preference for manipulating the earlier dimensions, this choice makes Take more flexible when used with the [[Rank operator]].<ref>Bernecky, Robert. [https://dl.acm.org/citation.cfm?id=55632 "An Introduction to Function Rank"]. APL88 Conference Proceedings. ''ACM SIGAPL Quote Quad'', 18(2), December 1987.</ref> It was adopted in [[Dyalog APL 13.0]] (2011), and has been present in [[J]] and [[ngn/apl]] since early development.
[[SHARP APL]] 19.0, released in 1987, extended Take to allow short left arguments. The choice to align left argument elements with the leading axes of the right argument was made according to the nascent [[leading axis theory]]: while a user may not have any preference for manipulating the earlier dimensions, this choice makes Take more flexible when used with the [[Rank operator]].<ref>[[Bob Bernecky|Bernecky, Robert]]. [https://dl.acm.org/citation.cfm?id=55632 "An Introduction to Function Rank"]. [[APL88]] Conference Proceedings. ''ACM SIGAPL Quote Quad'', 18(2), December 1987.</ref> It has been present in [[J]] and [[ngn/apl]] since early development, and was adopted in [[Dyalog APL 13.0]] (2011), as well as [[NARS2000]] between 2017 and 2019<ref>[[Bob Smith|Smith, Bob]]. [http://www.sudleyplace.com/APL/Progress%202017-2019.pdf "Progress in NARS2000 October 2017 to September 2019"]. Presented at [[Minnowbrook]] 2019 and published independently.</ref>.


== Extension support ==
== Extension support ==

Navigation menu