Execute: Difference between revisions

From APL Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
{{Built-in|Execute|⍎}} is a [[primitive function]]. It allows the user to interpret a string as APL code.
{{Built-in|Execute|⍎}} is a [[primitive function]] that evaluates a [[string]] as APL code.


== Examples ==
== Examples ==
Line 6: Line 6:
1 2 3 4 5 6 7 8 9 10
1 2 3 4 5 6 7 8 9 10
</source>
</source>
A common use for this is to assign a value using a name given by a variable:
<source lang=apl>
      varName←'myVar'
      myValue←42
      {⍎varName,'←⍵'}myValue
      varName
myVar
      myVar
42
</source>
{{APL built-ins}}

Revision as of 13:40, 10 February 2020

Execute () is a primitive function that evaluates a string as APL code.

Examples

      ⍎'⍳10'
1 2 3 4 5 6 7 8 9 10

A common use for this is to assign a value using a name given by a variable:

      varName←'myVar'
      myValue←42
      {⍎varName,'←⍵'}myValue
      varName
myVar
      myVar
42
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