System command: Difference between revisions

From APL Wiki
Jump to navigation Jump to search
Tags: Mobile edit Mobile web edit
m (Text replacement - "</source>" to "</syntaxhighlight>")
Line 1: Line 1:
'''System commands''' provide services or information associated with the workspace and the environment. They are not part of the APL language itself.
'''System commands''' provide services or information associated with the workspace and the environment. They are not part of the APL language itself.


APL system commands start with a right parenthesis, e.g., <source lang=apl inline>)save</source>, <source lang=apl inline>)pcopy</source>.
APL system commands start with a right parenthesis, e.g., <source lang=apl inline>)save</syntaxhighlight>, <source lang=apl inline>)pcopy</syntaxhighlight>.


== List of system commands ==
== List of system commands ==
Line 10: Line 10:
! Command !! Description
! Command !! Description
|-
|-
| <source lang=apl inline>)CLEAR</source> || Clear active workspace.
| <source lang=apl inline>)CLEAR</syntaxhighlight> || Clear active workspace.
|-
|-
| <source lang=apl inline>)COPY</source> || Copy library workspace / Copy library workspace object.
| <source lang=apl inline>)COPY</syntaxhighlight> || Copy library workspace / Copy library workspace object.
|-
|-
| <source lang=apl inline>)DROP</source> || Drop library workspace.
| <source lang=apl inline>)DROP</syntaxhighlight> || Drop library workspace.
|-
|-
| <source lang=apl inline>)ERASE</source> || Erase global referent.
| <source lang=apl inline>)ERASE</syntaxhighlight> || Erase global referent.
|-
|-
| <source lang=apl inline>)FNS</source> || Lists global function names.
| <source lang=apl inline>)FNS</syntaxhighlight> || Lists global function names.
|-
|-
| <source lang=apl inline>)LIB</source> || List library directory.
| <source lang=apl inline>)LIB</syntaxhighlight> || List library directory.
|-
|-
| <source lang=apl inline>)LOAD</source> || Load library workspace.
| <source lang=apl inline>)LOAD</syntaxhighlight> || Load library workspace.
|-
|-
| <source lang=apl inline>)NMS</source> || List global names and their name class.  
| <source lang=apl inline>)NMS</syntaxhighlight> || List global names and their name class.  
|-  
|-  
| <source lang=apl inline>)OPS</source> || List global operator names.  
| <source lang=apl inline>)OPS</syntaxhighlight> || List global operator names.  
|-
|-
| <source lang=apl inline>)SAVE</source> || Save active workspace / Save active workspace with name.
| <source lang=apl inline>)SAVE</syntaxhighlight> || Save active workspace / Save active workspace with name.
|-
|-
| <source lang=apl inline>)SI</source> || List state indicator.
| <source lang=apl inline>)SI</syntaxhighlight> || List state indicator.
|-
|-
| <source lang=apl inline>)SIC</source> || Clear state indicator.
| <source lang=apl inline>)SIC</syntaxhighlight> || Clear state indicator.
|-
|-
| <source lang=apl inline>)SINL</source> || List state indicator and local names.
| <source lang=apl inline>)SINL</syntaxhighlight> || List state indicator and local names.
|-
|-
| <source lang=apl inline>)VARS</source> || List global variable names.
| <source lang=apl inline>)VARS</syntaxhighlight> || List global variable names.
|-
|-
| <source lang=apl inline>)WSID</source> || List workspace identification / Change workspace identification.
| <source lang=apl inline>)WSID</syntaxhighlight> || List workspace identification / Change workspace identification.
|}
|}


Line 46: Line 46:
! Command !! Description
! Command !! Description
|-
|-
| <source lang=apl inline>)classes</source> || Lists the APL classes in the active workspace.
| <source lang=apl inline>)classes</syntaxhighlight> || Lists the APL classes in the active workspace.
|-
|-
| <source lang=apl inline>)clear</source> || Clear the workspace.
| <source lang=apl inline>)clear</syntaxhighlight> || Clear the workspace.
|-
|-
| <source lang=apl inline>)cmd {Y}</source> || Executes an operating system command; equivalent to <source lang=apl inline>)sh</source>.
| <source lang=apl inline>)cmd {Y}</syntaxhighlight> || Executes an operating system command; equivalent to <source lang=apl inline>)sh</syntaxhighlight>.
|-
|-
| <source lang=apl inline>)continue</source> || Saves the active workspace as Continue and terminate APL.
| <source lang=apl inline>)continue</syntaxhighlight> || Saves the active workspace as Continue and terminate APL.
|-
|-
| <source lang=apl inline>)copy {Y}</source> || Copies all or selected objects from a saved workspace into the active workspace.  
| <source lang=apl inline>)copy {Y}</syntaxhighlight> || Copies all or selected objects from a saved workspace into the active workspace.  
|-
|-
| <source lang=apl inline>)cs {Y}</source> || Change current namespace.
| <source lang=apl inline>)cs {Y}</syntaxhighlight> || Change current namespace.
|-
|-
| <source lang=apl inline>)drop {Y}</source> || Deletes a named workspace.
| <source lang=apl inline>)drop {Y}</syntaxhighlight> || Deletes a named workspace.
|-
|-
| <source lang=apl inline>)ed Y</source> || Opens an object in the editor.
| <source lang=apl inline>)ed Y</syntaxhighlight> || Opens an object in the editor.
|-
|-
| <source lang=apl inline>)erase Y</source> || Deletes objects from the active workspace.
| <source lang=apl inline>)erase Y</syntaxhighlight> || Deletes objects from the active workspace.
|-
|-
| <source lang=apl inline>)events</source> || Lists the events that the current GUI namespace may generate.
| <source lang=apl inline>)events</syntaxhighlight> || Lists the events that the current GUI namespace may generate.
|-
|-
| <source lang=apl inline>)fns {Y}</source> || Lists global functions in the active workspace.
| <source lang=apl inline>)fns {Y}</syntaxhighlight> || Lists global functions in the active workspace.
|-
|-
| <source lang=apl inline>)holds</source> || Lists the tokens acquired or requested by :Hold.
| <source lang=apl inline>)holds</syntaxhighlight> || Lists the tokens acquired or requested by :Hold.
|-
|-
| <source lang=apl inline>)interfaces</source> || List the currently active interfaces.
| <source lang=apl inline>)interfaces</syntaxhighlight> || List the currently active interfaces.
|-
|-
| <source lang=apl inline>)lib {Y}</source> || Lists all available workspaces or workspaces in a directory Y.
| <source lang=apl inline>)lib {Y}</syntaxhighlight> || Lists all available workspaces or workspaces in a directory Y.
|-
|-
| <source lang=apl inline>)load {Y}</source> || Replace the active workspace by a saved workspace.
| <source lang=apl inline>)load {Y}</syntaxhighlight> || Replace the active workspace by a saved workspace.
|-
|-
| <source lang=apl inline>)methods</source> || List methods in GUI namespace or object.
| <source lang=apl inline>)methods</syntaxhighlight> || List methods in GUI namespace or object.
|-
|-
| <source lang=apl inline>)ns {Y}</source> || Create a global namespace / Query the name of the current namespace.  
| <source lang=apl inline>)ns {Y}</syntaxhighlight> || Create a global namespace / Query the name of the current namespace.  
|-  
|-  
| <source lang=apl inline>)obs {Y}</source> || List the global namespaces in the active workspace. Synonym: <source lang=apl inline>)objects {Y}</source>.  
| <source lang=apl inline>)obs {Y}</syntaxhighlight> || List the global namespaces in the active workspace. Synonym: <source lang=apl inline>)objects {Y}</syntaxhighlight>.  
|-  
|-  
| <source lang=apl inline>)off</source> || Terminate APL immediately.
| <source lang=apl inline>)off</syntaxhighlight> || Terminate APL immediately.
|-
|-
| <source lang=apl inline>)ops {Y}</source> || Lists global operators in the active workspace.
| <source lang=apl inline>)ops {Y}</syntaxhighlight> || Lists global operators in the active workspace.
|-
|-
| <source lang=apl inline>)pcopy {Y}</source> || Protected copy. Similar to <source lang=apl inline>)copy</source>, but does not overwrite existing objects.
| <source lang=apl inline>)pcopy {Y}</syntaxhighlight> || Protected copy. Similar to <source lang=apl inline>)copy</syntaxhighlight>, but does not overwrite existing objects.
|-
|-
| <source lang=apl inline>)props</source> || List properties of GUI namespace or object.
| <source lang=apl inline>)props</syntaxhighlight> || List properties of GUI namespace or object.
|-
|-
| <source lang=apl inline>)reset</source> || Clears the execution stack (Reset the state indicator).
| <source lang=apl inline>)reset</syntaxhighlight> || Clears the execution stack (Reset the state indicator).
|-
|-
| <source lang=apl inline>)save {Y}</source> || Saves the active workspace to disk.
| <source lang=apl inline>)save {Y}</syntaxhighlight> || Saves the active workspace to disk.
|-
|-
| <source lang=apl inline>)sh {Y}</source> || Executes an operating system command; equivalent to <source lang=apl inline>)cmd</source>.
| <source lang=apl inline>)sh {Y}</syntaxhighlight> || Executes an operating system command; equivalent to <source lang=apl inline>)cmd</syntaxhighlight>.
|-
|-
| <source lang=apl inline>)si</source> || State Indicator.
| <source lang=apl inline>)si</syntaxhighlight> || State Indicator.
|-
|-
| <source lang=apl inline>)sic</source> || Clear State Indicator.
| <source lang=apl inline>)sic</syntaxhighlight> || Clear State Indicator.
|-
|-
| <source lang=apl inline>)sinl</source> || State Indicator with local Name List.
| <source lang=apl inline>)sinl</syntaxhighlight> || State Indicator with local Name List.
|-
|-
| <source lang=apl inline>)tid {Y}</source> || Switches to suspended thread, or lists the current thread number.
| <source lang=apl inline>)tid {Y}</syntaxhighlight> || Switches to suspended thread, or lists the current thread number.
|-
|-
| <source lang=apl inline>)vars {Y}</source> || Lists global variables in the active workspace.
| <source lang=apl inline>)vars {Y}</syntaxhighlight> || Lists global variables in the active workspace.
|-
|-
| <source lang=apl inline>)wsid {Y}</source> || Query / Set the identity of the active workspace.
| <source lang=apl inline>)wsid {Y}</syntaxhighlight> || Query / Set the identity of the active workspace.
|-
|-
| <source lang=apl inline>)xload Y</source> || Load a workspace without executing its Latent Expression (<source lang=apl inline>⎕LX</source>).
| <source lang=apl inline>)xload Y</syntaxhighlight> || Load a workspace without executing its Latent Expression (<source lang=apl inline>⎕LX</syntaxhighlight>).
|}
|}



Revision as of 10:25, 11 September 2022

System commands provide services or information associated with the workspace and the environment. They are not part of the APL language itself.

APL system commands start with a right parenthesis, e.g., <source lang=apl inline>)save</syntaxhighlight>, <source lang=apl inline>)pcopy</syntaxhighlight>.

List of system commands

ISO/IEC 13751:2001

ISO/IEC 13751:2001 standard defined the following system commands:[1]

Command Description
<source lang=apl inline>)CLEAR</syntaxhighlight> Clear active workspace.
<source lang=apl inline>)COPY</syntaxhighlight> Copy library workspace / Copy library workspace object.
<source lang=apl inline>)DROP</syntaxhighlight> Drop library workspace.
<source lang=apl inline>)ERASE</syntaxhighlight> Erase global referent.
<source lang=apl inline>)FNS</syntaxhighlight> Lists global function names.
<source lang=apl inline>)LIB</syntaxhighlight> List library directory.
<source lang=apl inline>)LOAD</syntaxhighlight> Load library workspace.
<source lang=apl inline>)NMS</syntaxhighlight> List global names and their name class.
<source lang=apl inline>)OPS</syntaxhighlight> List global operator names.
<source lang=apl inline>)SAVE</syntaxhighlight> Save active workspace / Save active workspace with name.
<source lang=apl inline>)SI</syntaxhighlight> List state indicator.
<source lang=apl inline>)SIC</syntaxhighlight> Clear state indicator.
<source lang=apl inline>)SINL</syntaxhighlight> List state indicator and local names.
<source lang=apl inline>)VARS</syntaxhighlight> List global variable names.
<source lang=apl inline>)WSID</syntaxhighlight> List workspace identification / Change workspace identification.

Dyalog APL

Dyalog APL supports the following system commands:

Command Description
<source lang=apl inline>)classes</syntaxhighlight> Lists the APL classes in the active workspace.
<source lang=apl inline>)clear</syntaxhighlight> Clear the workspace.
<source lang=apl inline>)cmd {Y}</syntaxhighlight> Executes an operating system command; equivalent to <source lang=apl inline>)sh</syntaxhighlight>.
<source lang=apl inline>)continue</syntaxhighlight> Saves the active workspace as Continue and terminate APL.
<source lang=apl inline>)copy {Y}</syntaxhighlight> Copies all or selected objects from a saved workspace into the active workspace.
<source lang=apl inline>)cs {Y}</syntaxhighlight> Change current namespace.
<source lang=apl inline>)drop {Y}</syntaxhighlight> Deletes a named workspace.
<source lang=apl inline>)ed Y</syntaxhighlight> Opens an object in the editor.
<source lang=apl inline>)erase Y</syntaxhighlight> Deletes objects from the active workspace.
<source lang=apl inline>)events</syntaxhighlight> Lists the events that the current GUI namespace may generate.
<source lang=apl inline>)fns {Y}</syntaxhighlight> Lists global functions in the active workspace.
<source lang=apl inline>)holds</syntaxhighlight> Lists the tokens acquired or requested by :Hold.
<source lang=apl inline>)interfaces</syntaxhighlight> List the currently active interfaces.
<source lang=apl inline>)lib {Y}</syntaxhighlight> Lists all available workspaces or workspaces in a directory Y.
<source lang=apl inline>)load {Y}</syntaxhighlight> Replace the active workspace by a saved workspace.
<source lang=apl inline>)methods</syntaxhighlight> List methods in GUI namespace or object.
<source lang=apl inline>)ns {Y}</syntaxhighlight> Create a global namespace / Query the name of the current namespace.
<source lang=apl inline>)obs {Y}</syntaxhighlight> List the global namespaces in the active workspace. Synonym: <source lang=apl inline>)objects {Y}</syntaxhighlight>.
<source lang=apl inline>)off</syntaxhighlight> Terminate APL immediately.
<source lang=apl inline>)ops {Y}</syntaxhighlight> Lists global operators in the active workspace.
<source lang=apl inline>)pcopy {Y}</syntaxhighlight> Protected copy. Similar to <source lang=apl inline>)copy</syntaxhighlight>, but does not overwrite existing objects.
<source lang=apl inline>)props</syntaxhighlight> List properties of GUI namespace or object.
<source lang=apl inline>)reset</syntaxhighlight> Clears the execution stack (Reset the state indicator).
<source lang=apl inline>)save {Y}</syntaxhighlight> Saves the active workspace to disk.
<source lang=apl inline>)sh {Y}</syntaxhighlight> Executes an operating system command; equivalent to <source lang=apl inline>)cmd</syntaxhighlight>.
<source lang=apl inline>)si</syntaxhighlight> State Indicator.
<source lang=apl inline>)sic</syntaxhighlight> Clear State Indicator.
<source lang=apl inline>)sinl</syntaxhighlight> State Indicator with local Name List.
<source lang=apl inline>)tid {Y}</syntaxhighlight> Switches to suspended thread, or lists the current thread number.
<source lang=apl inline>)vars {Y}</syntaxhighlight> Lists global variables in the active workspace.
<source lang=apl inline>)wsid {Y}</syntaxhighlight> Query / Set the identity of the active workspace.
<source lang=apl inline>)xload Y</syntaxhighlight> Load a workspace without executing its Latent Expression (<source lang=apl inline>⎕LX</syntaxhighlight>).

External links

Tutorials

Documentation

References

  1. BS ISO/IEC 13751:2001: Information technology. Programming languages, their environments and system software interfaces. Programming language Extended APL. (2001).


APL syntax [edit]
General Comparison with traditional mathematicsPrecedenceTacit programming (Train, Hook, Split composition)
Array Numeric literalStringStrand notationObject literalArray notation (design considerations)
Function ArgumentFunction valenceDerived functionDerived operatorNiladic functionMonadic functionDyadic functionAmbivalent functionDefined function (traditional)DfnFunction train
Operator OperandOperator valenceTradopDopDerived operator
Assignment MultipleIndexedSelectiveModified
Other Function axisBracket indexingBranchStatement separatorQuad nameSystem commandUser commandKeywordDot notationFunction-operator overloadingControl structureComment