Programs->R2->Reference
Reference
Home
  What's New
  Downloads
Programs
  CSS Editor
  TCP/IP
  rInstaller
  R
  R2
    Functions
    How It Works
    Basic Types
    Reference
  Java
Publications
  ODBC Browser
  Internet Server

Red Corona
Mail me




Note: these pages use the APL2741 or APLSans font, both available from Causeway.

R2 Reference

This is a list of all the tokens R2 recognises, and what arguments they can take. The following abbreviations for data types are used:
i: Integern: Numberc: Characters: String
v: Vector (eg nv=vector of numbers)a: Array (ia=array of integers only)null: Null{data}: data is shy.

Primitives

SymbolNiladicMonadicDyadic
+n/aa„+ a
Makes everything on the stack non-shy.
na„na + na
Add
-n/ana„- na
Negate
na„na - na
Subtract
÷n/ana„÷ na
Reciprocal
na„na ÷ na
Divide
×n/aia„× na
Sign (1/0/-1)
na„na × na
Multiply
*n/ana„* na
Exponenitate
na„na * na
Power
n/aia„— na
Ceiling
na„na — na
Max
˜n/aia„˜ na
Floor
na„na ˜ na
Min
^n/an/aia„ia ^ ia
Bitwise And
Ÿn/an/aia„ia Ÿ ia
Bitwise Or
Šn/an/aia„ia Š ia
Bitwise Nand (Not-And)
n/an/aia„ia ‹ ia
Bitwise Nor (Not-Or)
n/a{a}„ „ {a}
Sink (makes everything on the stack shy)
a„Identifier „ a
Assign
n/a…i/Label
Goto
a„a … ia
Get items by index
¼n/aiv„¼ i
The integers 1..n
a„a ¼ a
Index of one array in another
½n/aiv„½ a
Shape
a„iv ½ a
Reshape
/n/aa„Token/ a
Inserts the token between each pair of elements; e.g. +/[1 2 3] is 6.
a„iv / a
Compress
«NullNullNull

System Functions

FunctionNiladicMonadicDyadic
ŒDEPTHi„ŒDEPTH
The depth of the function stack
n/an/a
ŒEDn/aŒED c/cv/s
Edits a function or variable
n/a
ŒEXn/aŒEX c/cv/s
Deletes a function or variable
n/a
ŒOFFi„ŒOFF
Exits R2. If it returns, the value is 0.
n/an/a

System Variables

VariableRead-OnlyTypeMeaning
ŒAYescvThe uppercase alphabet
ŒALOWYescvThe lowercase alphabet
ŒABOTHYescvThe uppercase alphabet, followed by the lowercase alphabet
ŒAVYescvThe complete character set
ŒDYescvThe digits
ŒGLOBALSYescvThe characters which when used as the first letter of a name define that name to be global. This is set to ‘Œ
ŒIOYesiIndex origin; fixed to 1
ŒSHOWH