Execute

From APL Wiki
Jump to navigation Jump to search

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

It should be noted that executing user-provided data is not safe. Some implementations provide alternative safe functionality through the system functions Verify Input (⎕VI) and Fix Input (⎕FI)or the combined function Verify and Fix Input (⎕VFI).

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'
      myValue42
      {varName,'←⍵'}myValue
      varName
myVar
      myVar
42
APL built-ins [edit]
Primitive functions
Scalar
Monadic ConjugateNegateSignumNotRollType
Dyadic AddSubtractTimesDivideEqual to (Xnor) ∙ Not Equal to (Xor) ∙ MinimumMaximumComparison functionsComplex
Non-Scalar
Structural ShapeReshapeTallyDepthRavelReverseRazeMixCut (K)PairReplicatePartitioned Enclose
Selection FirstTakeDropUniqueIdentitySelectBracket index
Selector Index generatorInterval IndexIndices
Computational MatchNot MatchNub SieveFormatExecute
Primitive operators Monadic EachReplicateCommuteFunction axis
Dyadic BesideBindReverse Compose
Quad names
Arrays Index originMigration level
Functions
Operators