First: Difference between revisions

From APL Wiki
Jump to navigation Jump to search
No edit summary
m (Text replacement - "<source" to "<syntaxhighlight")
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Infobox terminology
{| class=vertical-navbox style="float:right; font-size:500%; margin:0 1ex;"
| title = {{Icon|⊃}} {{Icon|↑}}
|<code></code> <code>↑</code>
| en = First, [[Disclose]]
|}
}}
'''First''' (<code>⊃</code> or <code>↑</code> and also called '''[[Disclose]]''') is a [[monadic function]] in [[Nested array model|nested]] APLs which extracts the first [[element]] in [[ravel order]] from its argument, or, if the argument is [[empty]], returns its [[prototype]]. The [[glyph]] used varies by dialect. In a [[Nested array model|nested]] APL, First reduces the positive [[depth]] of an argument other than a [[simple scalar]] by at least one; in a [[Flat array model|flat]] APL it does not change the depth. A flat array language may also use the [[Head]] function to get the first [[major cell]] of its argument rather than the first 0-[[cell]]. In this case First can be obtained by [[take|taking]] the Head of the [[Ravel]] of the argument.
'''First''' is a [[monadic function]] in [[Nested array model|nested]] APLs which extracts the first [[element]] in [[ravel order]] from its argument, or, if the argument is [[empty]], returns its [[prototype]]. The [[glyph]] used varies by dialect. In a [[Nested array model|nested]] APL, First reduces the positive [[depth]] of an argument other than a [[simple scalar]] by at least one; in a [[Flat array model|flat]] APL it does not change the depth. A flat array language may also use the [[Head]] function to get the first [[major cell]] of its argument rather than the first 0-[[cell]]. In this case First can be obtained by [[take|taking]] the Head of the [[Ravel]] of the argument.


== External links ==
== External links ==
Line 13: Line 12:
=== Documentation ===
=== Documentation ===


* [https://help.dyalog.com/18.0/#Language/Primitive%20Functions/Disclose.htm Dyalog] (<source lang=apl inline>⊃</source>)
* [https://help.dyalog.com/18.0/#Language/Primitive%20Functions/Disclose.htm Dyalog] (<syntaxhighlight lang=apl inline>⊃</syntaxhighlight>)
* [http://microapl.com/apl_help/ch_020_020_550.htm APLX] (<source lang=apl inline>↑</source>)
* [http://microapl.com/apl_help/ch_020_020_550.htm APLX] (<syntaxhighlight lang=apl inline>↑</syntaxhighlight>)
* [https://mlochbaum.github.io/BQN/doc/pick.html#first BQN]
 
== See also ==
== See also ==
* [[Mix]]
* [[Mix]]
* [[Right Shoe]]
* [[Right Shoe]]
{{APL built-ins}}[[Category:Primitive functions]]
{{APL built-ins}}[[Category:Primitive functions]]

Latest revision as of 21:59, 10 September 2022

First ( or and also called Disclose) is a monadic function in nested APLs which extracts the first element in ravel order from its argument, or, if the argument is empty, returns its prototype. The glyph used varies by dialect. In a nested APL, First reduces the positive depth of an argument other than a simple scalar by at least one; in a flat APL it does not change the depth. A flat array language may also use the Head function to get the first major cell of its argument rather than the first 0-cell. In this case First can be obtained by taking the Head of the Ravel of the argument.

External links

Lessons

Documentation

See also

APL built-ins [edit]
Primitives (Timeline) Functions
Scalar
Monadic ConjugateNegateSignumReciprocalMagnitudeExponentialNatural LogarithmFloorCeilingFactorialNotPi TimesRollTypeImaginarySquare RootRound
Dyadic AddSubtractTimesDivideResiduePowerLogarithmMinimumMaximumBinomialComparison functionsBoolean functions (And, Or, Nand, Nor) ∙ GCDLCMCircularComplexRoot
Non-Scalar
Structural ShapeReshapeTallyDepthRavelEnlistTableCatenateReverseRotateTransposeRazeMixSplitEncloseNestCut (K)PairLinkPartitioned EnclosePartition
Selection FirstPickTakeDropUniqueIdentityStopSelectReplicateExpandSet functions (IntersectionUnionWithout) ∙ Bracket indexingIndexCartesian ProductSort
Selector Index generatorGradeIndex OfInterval IndexIndicesDealPrefix and suffix vectors
Computational MatchNot MatchMembershipFindNub SieveEncodeDecodeMatrix InverseMatrix DivideFormatExecuteMaterialiseRange
Operators Monadic EachCommuteConstantReplicateExpandReduceWindowed ReduceScanOuter ProductKeyI-BeamSpawnFunction axisIdentity (Null, Ident)
Dyadic BindCompositions (Compose, Reverse Compose, Beside, Withe, Atop, Over) ∙ Inner ProductDeterminantPowerAtUnderRankDepthVariantStencilCutDirect definition (operator)Identity (Lev, Dex)
Quad names Index originComparison toleranceMigration levelAtomic vector