Zilde: Difference between revisions

From APL Wiki
Jump to navigation Jump to search
Miraheze>Marshall
(Created page with "'''Zilde''' is the empty numeric vector. It is the shape of any scalar, although its own shape is <source lang=apl inline>,0</source> (Zilde's shape cannot...")
 
Miraheze>Adám Brudzewsky
No edit summary
Line 1: Line 1:
'''Zilde''' is the [[empty]] [[numeric]] [[vector]]. It is the [[shape]] of any [[scalar]], although its own shape is <source lang=apl inline>,0</source> (Zilde's shape cannot be Zilde, as that would mean it were a scalar). Zilde is equivalent to <source lang=apl inline>⍴0</source> or <source lang=apl inline>0⍴0</source>.
{{Primitive|⍬|Zilde}} is the [[empty]] numeric [[vector]]. It is the [[shape]] of any [[scalar]], although its own shape is <source lang=apl inline>,0</source>. This is because it has [[rank]] 1 (i.e. it is a vector), so it has exactly one [[axis]] (i.e. its shape is a 1-element vector) with the length 0. (Zilde's shape cannot be Zilde, as that would indicate that it had rank 0, i.e. it were a scalar.) Zilde is equivalent to <source lang=apl inline>⍳0</source> and <source lang=apl inline>⍴0</source> and <source lang=apl inline>0⍴0</source>. Being [[numeric]], Zilde's [[prototype]] is 0.


Zilde is notable for being the only APL glyph which represents an array rather than a [[primitive function]] or [[primitive operator]]. In most APLs it is the only array literal which is produced using its own token rather than being part of a family of array literals like [[numeric literals]], [[strings]], or [[system constants]].
Zilde is notable for being an APL [[glyph]] which represents an array rather than a [[primitive function]] or [[primitive operator]]. In most APLs it is the only array literal which is produced using its own token rather than being part of a family of array literals like [[numeric literals]], [[strings]], or [[system constants]]. Exceptions are:
 
* [[Dyalog APL]]'s <source lang=apl inline>#</source> which is the current [[workspace]]'s root [[namespace]]
* [[SHARP APL]]'s <source lang=apl inline>∘</source> which is ''nil'', or <source lang=apl inline>⊂⍬</source>
* [[NARS2000]] and [[ngn/apl]]'s <source lang=apl inline>∞</source> denoting infinity
 
It should be noted that the empty numeric vector (<source lang=apl inline>⍬</source>) is distinct from the empty character vector (<source lang=apl inline>''</source>) while comparing "all" their elements would seem to indicate that they are identical:
<source lang=apl>
      ⍬≡''
0
      ∧/⍬=''
1
</source>
This is because <source lang=apl inline>⍬=''</source> itself returns an empty numeric vector, and reducing an empty vector with the [[Logical And]] function (<source lang=apl inline>∧</source>) yields the [[identity element]] of Logical And, which is 1.


{{APL built-ins}}
{{APL built-ins}}

Revision as of 19:52, 30 October 2019

Template:Primitive is the empty numeric vector. It is the shape of any scalar, although its own shape is ,0. This is because it has rank 1 (i.e. it is a vector), so it has exactly one axis (i.e. its shape is a 1-element vector) with the length 0. (Zilde's shape cannot be Zilde, as that would indicate that it had rank 0, i.e. it were a scalar.) Zilde is equivalent to ⍳0 and ⍴0 and 0⍴0. Being numeric, Zilde's prototype is 0.

Zilde is notable for being an APL glyph which represents an array rather than a primitive function or primitive operator. In most APLs it is the only array literal which is produced using its own token rather than being part of a family of array literals like numeric literals, strings, or system constants. Exceptions are:

It should be noted that the empty numeric vector () is distinct from the empty character vector ('') while comparing "all" their elements would seem to indicate that they are identical:

      ⍬≡''
0
      ∧/⍬=''
1

This is because ⍬='' itself returns an empty numeric vector, and reducing an empty vector with the Logical And function () yields the identity element of Logical And, which is 1.


APL built-ins [edit]
Primitives (Timeline) Functions
Scalar
Monadic ConjugateNegateSignumReciprocalMagnitudeExponentialNatural LogarithmFloorCeilingFactorialNotPi TimesRollTypeImaginarySquare Root
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 axis
Dyadic BindCompositions (Compose, Reverse Compose, Beside, Withe, Atop, Over) ∙ Inner ProductDeterminantPowerAtUnderRankDepthVariantStencilCutDirect definition (operator)
Quad names Index originComparison toleranceMigration levelAtomic vector