Difference between revisions of "Execute"

From APL Wiki
Jump to navigation Jump to search
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'
      myValue42
      {varName,'←⍵'}myValue
      varName
myVar
      myVar
42
APL built-ins [edit]
Primitive functions
Scalar
Monadic ConjugateNotRollType
Dyadic AddSubtractEqual to (Xnor) ∙ Not Equal to (Xor)
Non-Scalar
Structural ShapeReshapeTallyDepthRavelReverseRazeMixCut (K)Pair
Selection TakeDropUniqueIdentitySelect
Selector Interval Index
Computational MatchNot MatchNub SieveFormatExecute
Primitive operators EachReverse Compose
Quad names
Arrays Index originMigration level
Functions
Operators
Other ZildeHigh minusFunction axis