Stop: Difference between revisions

From APL Wiki
Jump to navigation Jump to search
(Also in A+, where it returns an empty vector of symbols)
(⊢⍨)
 
Line 2: Line 2:


In other dialects, monadic <syntaxhighlight lang=apl inline>⊣</syntaxhighlight> is the [[identity function]], exactly like <syntaxhighlight lang=apl inline>⊢</syntaxhighlight>. This redundancy means that it can be redefined without losing any primitive functionality. However, pairing both dyadic functions with the identity may be useful in constructing [[ambivalent]] functions, particularly in [[tacit]] programming. In [[April]], monadic <syntaxhighlight lang=apl inline>⊣</syntaxhighlight> ("Empty") returns its argument is returned as a shy result, giving it the properties of both Stop and the identity.
In other dialects, monadic <syntaxhighlight lang=apl inline>⊣</syntaxhighlight> is the [[identity function]], exactly like <syntaxhighlight lang=apl inline>⊢</syntaxhighlight>. This redundancy means that it can be redefined without losing any primitive functionality. However, pairing both dyadic functions with the identity may be useful in constructing [[ambivalent]] functions, particularly in [[tacit]] programming. In [[April]], monadic <syntaxhighlight lang=apl inline>⊣</syntaxhighlight> ("Empty") returns its argument is returned as a shy result, giving it the properties of both Stop and the identity.
In dialects where <syntaxhighlight lang=apl inline>⊣</syntaxhighlight> does not return the argument when used monadically, the effect can be achieved with <syntaxhighlight lang=apl inline>⊢⍨</syntaxhighlight> using the [[commute]] operator.


== Documentation ==
== Documentation ==

Latest revision as of 08:17, 5 March 2024

Stop () (in SHARP APL and APLX), Hide (in GNU APL and Kap), or Null (in A+) is a primitive monadic function that ignores its argument and returns a non-printing value. It shares the left tack glyph with Left Identity. The nature of the returned value can vary: for example an empty matrix is used in SAX and APLX, while GNU APL uses the scalar 0 but returns it as a shy result (or "committed"). In SHARP APL's initial implementation of , Stop returned "no result", so that attempting to use its result would be an error.[1]

In other dialects, monadic is the identity function, exactly like . This redundancy means that it can be redefined without losing any primitive functionality. However, pairing both dyadic functions with the identity may be useful in constructing ambivalent functions, particularly in tacit programming. In April, monadic ("Empty") returns its argument is returned as a shy result, giving it the properties of both Stop and the identity.

In dialects where does not return the argument when used monadically, the effect can be achieved with ⊢⍨ using the commute operator.

Documentation

References

  1. "Language Extensions of May 1983". SATN-45, 1983-05-02.
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