APLX Help : Help on APL language : APL Primitives : ⍎ Execute
|
|
![]() |
|
Execute, followed by an APL text expression, causes the expression to be evaluated as if it had been entered at the keyboard in calculator mode. This has numerous applications, some of which are briefly summarized below. It can be used to turn character data, which contains numeric characters only, into numeric data: LIST ← '345 567' ⍴ LIST 7 (LIST contains 7 characters.) ⍴ ⍎ LIST (LIST is executed, and ⍴ is applied to the 2 result - 2 numbers) 1 + ⍎ LIST (This demonstrates that the 346 568 executed form of LIST can be used in arithmetic) It can be used as an alternative to branching in a user-defined function: [4] ⍎ (LOOP=10)/'DATA←DATA×10' If LOOP does not equal 10 when line 4 is executed, the In APLX, system commands can be executed using the ∇LIB [1] ⍝ Show contents of library 0 [2] ⍎')LIB' [3] ∇ The output from executed system commands can be captured in a variable: X←⍎')SYMBOLS' X IS 1026, USED 21
With an existing function called FUNCTION: ⍎'∇FUNCTION[3]A←2∇' ⍎'∇FUNCTION[2]B←1' (Note ⍎ supplies the closing ∇) With an existing function called FN: ∇FN[⎕]∇ (Function with no result) [1] A←1 2 3 ∇ ⍴FN VALUE ERROR ⍴FN ^ ⍴⍎'FN' (Execution gives an empty vector result) 0 |
|
APLX Help : Help on APL language : APL Primitives : ⍎ Execute
|
Copyright © 1996-2010 MicroAPL Ltd