The symbols are ordered here by type of function (arithmetic, structuring, etc.) and are followed by the dyadic and monadic names:
System Variable Names and References `busexit Bus Error Flag `corelim Core File Size Limit `cx Context `Df Dependency Flag `dyme Dynamic Environment `Ef Execution Suspension Flag `Gf Protected Execute Flag `language Language Level `loadfile File Being Loaded `majorRelease Major Release Number `minorRelease Minor Release Number `mode Input Mode `phaseOfRelease Phase of the Release `pp Printing Precision `releaseCode Release Code `rl Random Link `segvexit Segv Error Flag `Sf Callback Flag `si K Stack `stdin Standard Input `stop Stop `Tf Terminal Flag `vers Version `Xf X Events Flag
System Command Names and References $| Pipe $< Pipe In $> Pipe Out $>> Pipe Out Append $cd Change Directory $cmds Commands $cx Context $cxs Contexts $dbg Debugging State $def Dependency Definition $dep Dependent Object Names $deps Dependencies $Df Dependency Flag $Ef Execution Suspension Flag $ex Expunge $excxt Expunge Context $fns Functions $Gf Protected Execute Flag $globs Global Objects $load Load $loadrm Load and Remove $mode Input Mode $off Off $ops Operators $pp Printing Precision $reset Reset $rl Random Link $Sf Callback Flag $sfs System Functions $si State Indicator $stop Stop $Tf Terminal Flag $undef Remove Dependency Definition $vars Variables $vers Version $wa Workspace Available $Xf X Events Flag $xfs External Functions
Examples of Operators Expression Description Example fn@n Rank: fn applied to all rank-n subarrays è@1 vect +@1 mat fn¡ Each: for each scalar s: < fn >s i +¡ É¡ n fd¡ Apply enclosed function fd fû(+;-); x f[0]¡ y
Examples of Operators Operator Expression Remarks Rank ,@0 vû?4Ò9 Ravel applied to scalars Rank v ,@0 mû?3 4Ò9 Catenate applied scalar by scalar Rank m +@1 0 vû?3Ò9 vector-scalar (also m +@¢1 v) Rank m +.«@1 1 0 m vector-vector (all other axes are all versus all) Inner Product x f.g y: f/x(g@0 ¢1 1)y Outer Product x Ê.g y: x (g@0 0 0) y
Table of Data Types Data Type A+ Symbol Examples character `char 'per cent' and '' and "net" integer `int 0 and 4 14 59 86 and É0 floating point (IEEE double precision) `float 3.26 1e5 ¢3.1e-2 and 0 0Ò2. box (enclosed object) and nested array with first item of type box `box (3 4;5) and (`ns;1;+) and <7. empty array other than character, integer, and floating point, including the Null `null () and 0 0 Ò(2;3 4;5) and 0Ò`a`b and 0Ù(+;-;«;ß;`s) symbol, and nested array with first item simple symbol `sym `pp and `rl `stop and `ns,(1;+) function expression, function scalar, and nested array with first item function scalar `func + and <{+} and (+;-;«;ß) and (<{+}),`sand («;2 3;'a')
Examples of Primitive Functions Sym Description Monadic Example Dyadic Example # Tally and Choose #É8 and #É2 3 1#É8 and 1#É2 3 Ú Partition Count and Partition Ú1 0 1 0 0 2 3ÚÉ5 Ø Raze and Pick Ø(2 3; 4 5 6) 1Ø(2 3; 4 5 6) ! Item Ravel and Restructure !É2 3 2!É8 and ¢2!É8 ~ Not and Laminate ~1 0 1 4~É9 © Type and Cast ©`ibm `char©É256 Â Pack and Decode Â'ibm' 24 60 60Â2 5 59 Î Unpack and Encode Î`ibm 24 60 60Î7559 à Map In and Map à`f `f à É9 and 1à`f (open-write) è Grade Up and Bins è?1000Ò100 ¢1 0 1 è .3 1 5
Example of a Defined Function:
Signal (Ù) Display (Õ) Stop&Trace (^) Return (û) and Line NumbersFunction Definition Function Line Indicator
$siMeaning
n foo t:{
if(ÒÒn) Ù `rank;
if (~n) Ù `stop;
if (n<0) û Õn;
(mûn) do{
^m;
tût,t[m]};
t}
foo[1]
foo[2]
foo[3]
foo[4]
foo[4 do 1]
foo[4 do 2]
foo[5]
signal rank error
(for if and while,
only zero is false)
signal stop
display and return n
repeat n times
(m runs from
0 through n-1)
stop, or trace m
use m as index
return t (last expression)
When there is an error the function and error type is shown. For example,
+: length
or
.foo: rank
This is preceded by
ã[error]
When there is a stop the function and message are shown; names are shown fully qualified. At this point you can take one of the actions shown in the following table.
Error and Stop Actions User Action A+ Expression reset (abort) $ or ý show state $si signal up an error Ù`length return x û x resume execution,
with an enlarged workspace
when the error was wsfullû inspect the stack &0 (for entry 0) change entries on the stack &1 û 2 3 4 (entry 1) A leading * is displayed for every level of resetting required to get clear. The state indicator shows a line for every function call.
The & symbol by itself represents self-reference; for example:
fact n: if (n>0) n« & n-1 else 1
is the standard recursive factorial definition.
File Names Form of Name Use Example *. or
*.+ or
*.afunction and data definitions util.+ *.m mappable simple arrays price.m
Printing Files Command Meaning File Type $| var lpr Pipe the file named var to lpr command. reports or variables
Getting Around
Command Meaning Example $cd change Unix directory $cd /u/a $cx change A+ context $cx stat Name Use All files (.a .+ .m .c etc.) are in the Unix hierarchical file system, and can always be referred to by their full pathnames. All A+ global variables are in either the root context or other contexts, and can be referred to by context.name .
Examples of System Command Syntax and Meaning Command Meaning $cd [d] current [change to d] directory $load fns load fns. or fns.+ or fns.a $cx [x] current [change to x] context $vars [x] list variables (in current [or x] context) $fns [x] list functions (in current [or x] context) $ops [x] list operators (in current [or x] context) $xfs [x] list external functions (in current [or x] context) $ex name[s] expunge name[s] in current context $cxs list all contexts $sfs list system functions $wa [m] workspace available [add m megabytes].
(When a wsfull error is encountered, û alone on a line causes execution to be resumed with an enlarged workspace.)$pp [n] current [change to n] printing precision $rl n set random link $si state indicator stack $stop [0 | 1 | 2] stops [off or on or trace] $cmds list the commands $off sign off
Examples of Unix Command Syntax and Meaning Command Meaning $ls *.a list all .a files $rm t.m remove t.m $mv f g move f to g $cp f g copy f to g $df /s/atmp disk free for workspace $mkdir d make a new directory d $rmdir d remove directory d $date display the date Any non-A+ system command remove $ and pass to Unix
Graphic Characters for Atomic Vector
(`char©É16 16) (HEX row and column labels)
0 1 2 3 4 5 6 7 8 9 A B C D E F
00 10 20 30 40 50 60 70 80 90 A0 B0 C0 D0 E0 F0
! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~ ? ¡ ¢ ¤ ¦ ¨ © « ¬ ® ¯ ° ± ³ ´ ¶ ¹ » ¼ ½ ¾ ¿ Á Â Ã Ä Å Ç È É Ê Ì | Î Ï Ò Ó Õ Ö × Ø Ù Ú Û Ü Ý ß à á â ã å æ ç è é ê ì î ï ð ô ÷ ú û ü ý þ
0F 1F 2F 3F 4F 5F 6F 7F 8F 9F AF BF CF DF EF FF
0 1 2 3 4 5 6 7 8 9 A B C D E F
Parse-Time System Limits Entity Limit locals 999 items in a list notation 999 items in a vector notation 9999 nested parentheses depth 999 input strings 9999 number of function arguments 9 number of dyld'd function arguments 8
Run-Time System Limits Entity Limit addressability 4 billion bytes array rank 9 array dimensions 2 billion array depth approximately 87,0001 symbol length 2 billion simultaneously mapped files (else a maplim error occurs) 2,000 default, but can be increased or decreased by $maplim and `maplim. open file descriptors Depends on system; for Solaris, the default soft limit (as shown by ulimit -a) is 256 and the hard limit (ulimit -Ha) is 1024. The limit includes adap connections, but not mapped files, which are closed after they are mapped. A+ recursive stack 2,000 ç, è recursive stack 10,000 integer roughly -2 billion to 2 billion (32 bits) float 16 decimal digits of precision (IEEE 64 bit); results beyond the 16th digit are not valid
- Depends on the depth of the C stack, and so on the machine architecture. [Back to table cell]
Click here to go to the interactive keyboard layout.
doc@aplusdev.org | © Copyright 19952008 Morgan Stanley Dean Witter & Co. All rights reserved. |