APL-20 PANDAMONIUM REIGNS!
APLSF (System Function) is an implementation of the APL programming language for TOPS-20 that is available on TWENEX.
To start the APL interpreter, type the following from EXEC:
@APLSF
At the terminal..
prompt, enter tty
for a non-APL keyboard.
Leave APLSF by entering one of the following commands (APLSF converts all alphabetic input to upper-case):
)MON | Terminate APLSF and return to EXEC. |
)OFF | Terminate APLSF and log out of TWENEX. |
)CONTINUE | Save active workspace to file DSK:CONTIN.APL , terminate APLSF, log-out from TWENEX. The saved workspace will be loaded automatically the next time you run APLSF. |
To interrupt APLSF during execution, press Ctrl-C
once or twice.
Press Ctrl-C
five (5) times to suspend APLSF and return to EXEC. Resume APLSF with command @REENTER
or @CONTINUE
.
Although APL characters cannot be displayed or input when the terminal is in TTY mode, APLSF provides ASCII character string equivalents for all the APL characters as well as “escape mode” (single character preceded by “@”) keys that correspond to standard APL keyboard mappings. ASCII and escape mode sequences can be intermixed.
APL Character | Name | ASCII | Escape Mode | APL Character | Name | ASCII | |
---|---|---|---|---|---|---|---|
∧ | and | & | ⍒ | Grade Down | .GD | ||
← | assignment | _ | ⍋ | Grade Up | .GU | ||
÷ | divide | % | ⌶ | I-Beam (histogram) | .IB | ||
⋆ | exponentiate | * | @E | ⍟ | LoGarithm | .LG | |
× | multiply | # | ⍲ | NaNd | .NN | ||
? | question (roll and deal) | ? | @Q | ⍱ | NoR | .NR | |
' | quote string | ' | @K | ⍀ | back expansion | .CB | |
↑ | take | ^ | @Y | ⊖ | (Circle) Rotate | .CR | |
∣ | residue (ABsolute value) | .AB | @M | ⌿ | back scan | .CS | |
α | ALpha | .AL | @A | ⌹ | Divide Quad | .DQ | |
⎕ | quad (BoX) | .BX | @L | Input Quad | .IQ | ||
⌈ | CEiling (maximum) | .CE | @S | Output Quad | .OQ | ||
↓ | drop (Down Arrow) | .DA | @U | OUt | .OU | ||
¨ | Dieresis | .DD | ⍫ | Protected Del | .PD | ||
⊥ | DEcode | .DE | @B | Quad Del | .QD | ||
∇ | DeL | .DL | @G | ⍞ | Quad Quote | ||
◊ | DiaMond | .DM | ⌽ | ReVersal | .RV | ||
∩ | Down Under | .DU | @C | ⍉ | TRanspose | .TR | |
⊤ | ENcode | .EN | @N | ⍎ | eXecute | .XQ | |
∈ | EPsilon | .EP | @E | ⍕ | ForMat | .FM | |
⌊ | FLoor | .FL | @D | ⍝ | Comment (lamp) | “ | |
≥ | Greater then or Equal to | .GE | A-Z | underscored alphabetics | .ZA-.ZZ | ||
→ | GO to (branch) | .GO | ⍙ | underscored lower del | .Z@ | ||
⍳ | IOta | .IO | @I | ||||
{ | Left curly Brace | .LB | |||||
∆ | delta (Lower Del) | .LD | @H | ||||
≤ | Less than or Equal to | .LE | |||||
⊢ | Left tacK | .LK | |||||
○ | circle (Large O) | .LO | @O | ||||
⊃ | Left Union | .LU | @X | ||||
≠ | Not Equal to | .NE | |||||
− | NeGation | .NG | |||||
∼ | NoT | .NT | @T | ||||
⍵ | OMega | .OM | @W | ||||
∨ | OR | .OR | |||||
} | Right curly Brace | .RB | |||||
⍴ | RhO | .RO | @R | ||||
⊣ | Right tacK | .RK | |||||
⊂ | Right Union | .RU | @Z | ||||
∘ | jot (Small O) | .SO | @J | ||||
_ | UnderScore | .US | @F | ||||
∪ | Up Union | .UU | @V |
)SAVE [wsname] | Save workspace in file DSK:wsname.APL . |
)LOAD wsname | Load saved workspace from file DSK:wsname.APL . |
)DROP wsname | Delete saved workspace file DSK:wsname.APL . |
)CLEAR | Clear active workspace. |
)FNS [letter] | List functions in workspace (starting alphabetic list from letter). |
)VARS [letter] | List global variables in workspace (starting alphabetic list from letter). |
)ERASE name … | Erase global variable or function name from workspace. |
To define a new function and invoke the editor, enter one of the following commands:
.DL[r_]a1 f a2[;v]… | Define a dyadic (two-argument infix) function |
.DL[r_]f a1[;v]… | Define a monadic (one-argument prefix) function |
.DL[r_]f[;v]… | Define a niladic (no-argument) function |
Where:
f | Function name |
a1, a2 | Dummy arguments |
r | Dummy variable for return value |
v | Local variable |
To edit an existing function, enter the command .DLf
.
The editor will start and prompt with the current line number, for example [1]
.
text | Add text at current line. |
[n]text | Replace line n with text. Edit the function header as line 0. |
[n.m]text | Insert text as new line after line n. (Lines are automatically renumbered after each editing session.) |
[.LDn] | Delete line n. |
[.BX] | List function source. |
[n.BX] | List line n. |
[.BXn] | List from line n to the end of the function. |
.DL | Save function and return from editor. |
Multiple commands can be entered on a single line. For an example, you can open the editor on existing function FUN1
, list its source, and immediately exit the editor by entering the following command in the APL interpreter:
.DLFUN1[.BX].DL