Execute: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
{{Built-in|Execute|⍎}} is a [[primitive function]] | {{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