Language Features: Difference between revisions

From NARS2000
Jump to navigationJump to search
Line 10: Line 10:
* [[Point Notation]]:  <ul><li>'''Base''' &mdash;  <apll>16b10FFFF</apll> as a shorthand for <apll>16{base}1 0 15 15 15 15</apll></li><li>'''Pi''' &mdash;  <apll>2p3</apll> as a shorthand for <apll>2π<sup>3</sup></apll> or <apll>2×(○1)*3</apll></li><li>'''Euler''' &mdash; <apll>2x3</apll> as a shorthand for <apll>2e<sup>3</sup></apll> or <apll>2×(*1)*3</apll>.</li></ul>
* [[Point Notation]]:  <ul><li>'''Base''' &mdash;  <apll>16b10FFFF</apll> as a shorthand for <apll>16{base}1 0 15 15 15 15</apll></li><li>'''Pi''' &mdash;  <apll>2p3</apll> as a shorthand for <apll>2π<sup>3</sup></apll> or <apll>2×(○1)*3</apll></li><li>'''Euler''' &mdash; <apll>2x3</apll> as a shorthand for <apll>2e<sup>3</sup></apll> or <apll>2×(*1)*3</apll>.</li></ul>
* [[Trains]]:  e.g., <apll>avg←(+⌿ ÷ ≢)</apll> applies the functions to its argument(s) in a particular way (in this case, to compute the average of a numeric scalar or vector).
* [[Trains]]:  e.g., <apll>avg←(+⌿ ÷ ≢)</apll> applies the functions to its argument(s) in a particular way (in this case, to compute the average of a numeric scalar or vector).
* [[System Labels]]:  <apll>⎕PRO</apll> and <apll>⎕ID</apll> in user-defined functions/operators.
* [[System Labels]]:  <apll>⎕ID</apll>, <apll>⎕MS</apll>, and <apll>⎕PRO</apll> in user-defined functions/operators.
* [[Anonymous Functions/Operators]]:  one-line grouping of one or more statements all enclosed in braces such as <apll>{(+⌿⍵)÷≢⍵}</apll>.
* [[Anonymous Functions/Operators]]:  one-line grouping of one or more statements all enclosed in braces such as <apll>{(+⌿⍵)÷≢⍵}</apll>.



Revision as of 09:15, 22 April 2014

At the moment, the following sections describe only those language features that are New or Enhanced relative to the Extended APL Standard, or that deserve special comment.

Syntax

Primitive functions

Primitive operators

Datatypes

System Commands

System Commands provide features to the user of the APL system, separate from actual workspaces, variables or APL operators. These provide such features as accessing files, saving a workspace, and exiting the APL interpreter. The commands are not case sensitive, so )IN and )in do the same thing.

NARS2000 currently has the following system commands:

)BOX Turn ON/OFF box around output
)CLEAR Start a new session manager window with an empty workspace
)CLOSE
)COPY
)DROP
)EDIT Create a new function in the workspace or edit an existing function
)ERASE Delete a variable or function in the current workspace
)EXIT Close down the interpreter and exit the program. Same as )OFF
)FNS
)FOP Display functions, operators, and hyperators. Same as )FOPS
)FOPS
)HYP Display hyperators only
)IN
)INASCII    
)LIB
)LAOD Alternative spelling of )LOAD
)LOAD Load an existing workspace
)NEWTAB
)NMS
)OFF Close down the interpreter and exit the program. Same as )EXIT
)OPEN
)OPS Display operators only
)OUT
)RESET
)SAVE Save the current workspace
)SVAE Alternative spelling for )SAVE
)SI workspace State Indicator
)SIC State Indicator Clear
)SINL
)SYMB
)ULIB
)VARS
)XLOAD
)WSID
 

System Variables and Functions

System Variables (A value may be assigned to these except for ⎕DM)
ALX CT DM DT ELX FC FEATURE FPC IC IO
LR LX PP PR PW RL SA WSID
Niladic System Functions (a value cannot be assigned to these)
A AV EM ET LC NNAMES NNUMS SI SYSID SYSVER
T TC TCBEL TCBS TCESC TCFF TCHT TCLF TCNL TCNUL
TS WA
Monadic or dyadic system functions (a value cannot be assigned to these)
AT CR DC DFT DL DR EA EC ERROR ES
EX FMT FX MF NAPPEND NC NCREATE NERASE NINFO NL
NLOCK NREAD NRENAME NREPLACE NRESIZE NSIZE NTIE NUNTIE STOP TF
TRACE UCS VR
Note that quad functions and variables (except for the ⎕A family of functions) are case insensitive