From: Difference between revisions

Jump to navigation Jump to search
642 bytes added ,  10:44, 27 April 2022
no edit summary
No edit summary
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Built-in|From|{}} or '''Select''' (<code>⊇</code>, or <code></code> in [[BQN]]) (sometimes [[humour]]ously called ''Sane Indexing'') is a [[primitive function]] that selects multiple [[major cell]]s of its right argument using an array of [[index|indices]] given by its left. The primitive often offers additional functionality for a [[nested]] left argument, which varies from one language to another. It appears in [[J]], [[Extended Dyalog APL]], [[dzaima/APL]], [[KAP]], and [[BQN]].
{| class=vertical-navbox style="float:right; font-size:500%; margin:0 1ex;"
|<code>⊇</code> <code>@</code>
|}
'''From''' (<code>⊇</code> or <code>@</code> and also called '''Select''', or, [[humour]]ously, ''Sane Indexing'') is a [[primitive function]] that selects multiple [[major cell]]s of its right argument using an array of [[index|indices]] given by its left. The primitive often offers additional functionality for a [[nested]] left argument, which varies from one language to another. It appears in [[SAX]] (as <source lang=apl inline>@</source>), [[Extended Dyalog APL]], [[dzaima/APL]], and [[KAP]] (as <source lang=apl inline>⊇</source>), [[J]] (as <source lang=j inline>{</source>), and [[BQN]] (as <code>⊏</code>).


== Common usage ==
== Common usage ==
Line 38: Line 41:


== History ==
== History ==
From (<code>{</code>) was introduced in 1986 by [[A Dictionary of APL]], with the same meaning now used in [[J]]. This description introduced the characteristic feature of selection of multiple cells simultaneously, as well as the pairing with monadic [[Catalogue]], scatter-point indexing, negative indices, and the ability to exclude rather than include indices using a third level of boxing. [[Roger Hui]] expressed his support for the new definition with a presentation at the next [[APL conference]]<ref>[[Roger Hui]]. [https://www.jsoftware.com/papers/from.htm Some Uses of { and }] at [[APL87]].</ref>, and it was included in J from the earliest drafts in 1990—a limited version had even appeared in [[Arthur Whitney]]'s one-page interpreter prototype.
From (<code>{</code>) was introduced in 1986 by [[A Dictionary of APL]], with the same meaning now used in [[J]]. This description introduced the characteristic feature of selection of multiple cells simultaneously, as well as the pairing with monadic [[Catalogue]], scatter-point indexing, negative indices, and the ability to exclude rather than include indices using a third level of boxing. [[Roger Hui]] expressed his support for the new definition with a presentation at the next [[APL conference]]<ref>[[Roger Hui]]. [https://www.jsoftware.com/papers/from.htm Some Uses of <code>{</code> and <code>}</code>] at [[APL87]].</ref>, and it was included in J from the earliest drafts in 1990—a limited version had even appeared in [[Arthur Whitney]]'s one-page interpreter prototype.
 
[[SHARP APL]] followed A Dictionary of APL and used <code>{</code>, but this was later deprecated, programmers being told to use <code>@</code> instead.<ref>Soliton Associates Limited. SHARP APL for UNIX Language Guide. [https://abrudz.github.io/SAX2/SAX61.pdf#G41.16516 Deprecated Primitives: Braces]. 2000.</ref>


The name Select and glyph <code>⊇</code> were introduced by [[Extended Dyalog APL]], and subsequently adopted by [[dzaima/APL]] and [[KAP]].
The name Select and glyph <code>⊇</code> were introduced by [[Extended Dyalog APL]], and subsequently adopted by [[dzaima/APL]] and [[KAP]].
Line 53: Line 58:
* J: [https://www.jsoftware.com/help/dictionary/d520.htm Dictionary], [https://code.jsoftware.com/wiki/Vocabulary/curlylf#dyadic Nuvoc]
* J: [https://www.jsoftware.com/help/dictionary/d520.htm Dictionary], [https://code.jsoftware.com/wiki/Vocabulary/curlylf#dyadic Nuvoc]
* [https://abrudz.github.io/SAX2/SAX61.pdf#M44.9.from SAX]
* [https://abrudz.github.io/SAX2/SAX61.pdf#M44.9.from SAX]
* [https://mlochbaum.github.io/BQN/doc/select.html BQN]


== References ==
== References ==
<references/>
<references/>
{{APL built-ins}}[[Category:Primitive functions]]
{{APL built-ins}}[[Category:Primitive functions]]

Navigation menu