4,494
edits
m (Text replacement - "<source" to "<syntaxhighlight") |
m (Text replacement - "</source>" to "</syntaxhighlight>") |
||
Line 1: | Line 1: | ||
{{Built-in|Execute|⍎}} is a [[primitive function]] that evaluates a [[string]] as APL code. | {{Built-in|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 function]]s [[Verify Input]] (<syntaxhighlight lang=apl inline>⎕VI</ | It should be noted that executing user-provided data is not safe. Some implementations provide alternative safe functionality through the [[system function]]s [[Verify Input]] (<syntaxhighlight lang=apl inline>⎕VI</syntaxhighlight>) and [[Fix Input]] (<syntaxhighlight lang=apl inline>⎕FI</syntaxhighlight>)or the combined function [[Verify and Fix Input]] (<syntaxhighlight lang=apl inline>⎕VFI</syntaxhighlight>). | ||
== Examples == | == Examples == | ||
Line 7: | Line 7: | ||
⍎'⍳10' | ⍎'⍳10' | ||
1 2 3 4 5 6 7 8 9 10 | 1 2 3 4 5 6 7 8 9 10 | ||
</ | </syntaxhighlight> | ||
A common use for this is to [[assignment|assign]] a value using a name given by a variable: | A common use for this is to [[assignment|assign]] a value using a name given by a variable: | ||
<syntaxhighlight lang=apl> | <syntaxhighlight lang=apl> | ||
Line 17: | Line 17: | ||
myVar | myVar | ||
42 | 42 | ||
</ | </syntaxhighlight> | ||
== See also == | == See also == | ||
* [[Format]] | * [[Format]] | ||
Line 26: | Line 26: | ||
* [https://help.dyalog.com/latest/#Language/Primitive%20Functions/Execute.htm Dyalog] | * [https://help.dyalog.com/latest/#Language/Primitive%20Functions/Execute.htm Dyalog] | ||
* [http://microapl.com/apl_help/ch_020_020_710.htm APLX] | * [http://microapl.com/apl_help/ch_020_020_710.htm APLX] | ||
* J [https://www.jsoftware.com/help/dictionary/d601.htm Dictionary], [https://code.jsoftware.com/wiki/Vocabulary/quotedot NuVoc] (as <syntaxhighlight lang=j inline>".</ | * J [https://www.jsoftware.com/help/dictionary/d601.htm Dictionary], [https://code.jsoftware.com/wiki/Vocabulary/quotedot NuVoc] (as <syntaxhighlight lang=j inline>".</syntaxhighlight>) | ||
{{APL built-ins}}[[Category:Primitive functions]] | {{APL built-ins}}[[Category:Primitive functions]] |