.\" Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985.
.so bfont.def
.pl 0
.ll 18c
.nh
.wh -.3c fo
.de fo \"page footer
'bp
.pl 35c
.po 0
.lt 21c
.tl '.''.'
.po 1.5c
.sp 2
.ns
..
.ds B \fIB\fP
.ds BB \fI\zB\h'3u'B\fP
.de HE \"Heading
.sp 0.9v
.ne 1.7v
\fB\\$1\fP \\$2
.sp .4v
.ns
..
.de IT
.sp .4v
.JT
..
.de JT
.ti 0
..
.de TA
.br
.sp -1
.ti 0
	
..
.fo
.rs
.sp 2
.ta 20n
.ps 16
	\*(BB\fB\ \|QUICK REFERENCE\fP
.ps 10
.sp 0.5
.ta 30n
.HE "GETTING STARTED"
.IT
\*(<:b\*(:>
.TA
Enter \*B system
.JT
\*(<:b -e\*(:>
.TA
Enter \*B system, using editor \fI$EDITOR\fP (default \fIvi\fP)
.JT
\*(<:b \*(:>\|\fIfile\fP .\^.\^.
.TA
Execute \*B commands in named files, and \*(<:QUIT\*(:>
.JT
\*(<:b -p\*(:>
.TA
Print all units in workspace on printer; do not enter \*B system
.JT
\*(<:b -l\*(:>
.TA
Print (list) all units on screen; do not enter \*B system
.JT
\*(<:b -i \*(:>\fItable\fP
.TA
Create a table of texts from the standard input
.JT
\*(<:b -o \*(:>\fItable\fP
.TA
Write a table of texts to the standard output
.HE "WHAT IS IN THE WORKSPACE ?" " (only as immediate commands)"
.IT
\*(<:==\*(:>
.TA
Display tags of current permanent targets
.JT
\*(<:::\*(:>
.TA
Display headings of current units
.HE "HOW TO MAKE CHANGES"
.IT
\*(<::\*(:>\fIunit-name\fP\0
.TA
Make changes to unit (default: unit last referred to)
.JT
\*(<:=\*(:>\fItarget-name\fP
.TA
Make changes to contents of target (last so changed)
.HE "Focus moves"
.ta 15n +20n
.de KK \"Key(s) that preceeding name of editing operation is bound to
.br
.sp -1
.ti 0
	
..
.de KY \"Key in box
'ps -2
'nh
\v'-\\n(.su/2u'\(br\v'\\n(.su/2u'\|\s-1\\$1\s+1\|\v'-\\n(.su/2u'\(br\v'\\n(.su/2u'\\h'-\\w'|'u/2u'\l'|0+(\\w'|'u/2u)\(rn'\\h'-\\w'|'u/2u'\l'|0\(ul'
'hy
'ps +2
..
.de OR
\&\ or\ 
..
.de DD \"Description of editing operation
.br
.sp -1
.ti 0
		
..
.IT
WIDEN
.KK
.KY f1
.OR
.KY ESC
.KY w
.DD
Widen focus
.JT
FIRST
.KK
.KY f2
.OR
.KY ESC
.KY f
.DD
Move focus to first contained item
.JT
LAST
.KK
.KY f3
.OR
.KY ESC
.KY l
.DD
Move focus to last contained item
.JT
EXTEND
.KK
.KY f4
.OR
.KY ESC
.KY e
.DD
Extend focus (usually to the right)
.JT
UPLINE
.KK
.KY f5
.OR
.KY ESC
.KY u
.DD
Move focus to whole of line above
.JT
PREVIOUS
.KK
.KY f6
.OR
.KY ESC
.KY p
.DD
Move focus to previous item
.JT
NEXT
.KK
.KY f7
.OR
.KY ESC
.KY n
.DD
Move focus to next item
.JT
DOWNLINE
.KK
.KY f8
.OR
.KY ESC
.KY d
.DD
Move focus to whole of line below
.JT
UP
.KK
.KY \(ua
.DD
Make new hole, move focus up
.JT
DOWN
.KK
.KY \(da
.DD
Make new hole, move focus down
.JT
LEFT
.KK
.KY \(<-
.DD
Make new hole, move focus left
.JT
RIGHT
.KK
.KY \(->
.DD
Make new hole, move focus right
.HE "Typing and making changes"
.IT
\fIAny character\fP
.DD
Insert character before focus
.JT
ACCEPT
.KK
.KY TAB
.DD
Accept suggestion, focus to next hole or end of line
.JT
RETURN
.KK
.KY RETURN
.DD
Go to new line, or decrease indentation
.JT
UNDO
.KK
.KY BACKSPACE
.DD
Undo effect of last key pressed (may be repeated)
.JT
REDO
.KK
.KY ctrl-U
.DD
Redo last UNDOne key (may be repeated)
.JT
DELETE
.KK
.KY ctrl-D
.DD
Delete contents of focus (to buffer)
.JT
COPY
.KK
.KY ctrl-C
.DD
Copy contents of focus to buffer, or buffer to hole
.HE "Other commands"
.IT
RECORD
.KK
.KY ctrl-R
.DD
Start/stop recording keystrokes
.JT
PLAY
.KK
.KY ctrl-P
.DD
Play back recorded keystrokes
.JT
LOOK
.KK
.KY ctrl-L
.DD
Redisplay screen
.JT
HELP
.KK
.KY ESC
.KY ?
.DD
Display summary of keys
.JT
EXIT
.KK
.KY ctrl-X
.DD
Finish changes or execute command
.JT
\fIInterrupt\fP
.KK
.KY BREAK
.OR
.KY DEL
.DD
Leave incomplete unit or interrupt command execution
.bp
.rs
.sp 2c
.ta 35n +5n
.HE "COMMANDS" " (\fItlt\fP is text, list or table)"
.IT
\*(<:WRITE\*(:> \fIexpr\fP\0
.TA
Write to terminal; \*(<:/\*(:> before or after \fIexpr\fP gives new line
.JT
\*(<:READ\*(:> \fItarget\fP \*(<:EG\*(:> \fIexpr\fP\0
.TA
Read expression from terminal to \fItarget\fP; \fIexpr\fP is example
.JT
\*(<:READ\*(:> \fItarget\fP \*(<:RAW\*(:>\0
.TA
Read line of text
.JT
\*(<:PUT\*(:> \fIexpr\fP \*(<:IN\*(:> \fItarget\fP
.TA
Put value of \fIexpr\fP in \fItarget\fP
.JT
\*(<:DRAW\*(:> \fItarget\fP\0
.TA
Random number from \*(<:~0\*(:> up to, but not including, \*(<:~1\*(:>
.JT
\*(<:CHOOSE\*(:> \fItarget\fP \*(<:FROM\*(:> \fItlt\fP\0
.TA
Random element of \fItlt\fP
.JT
\*(<:SET'RANDOM\*(:> \fIexpr\fP\0
.TA
Start random sequence for \*(<:DRAW\*(:> and \*(<:CHOOSE\*(:>
.JT
\*(<:REMOVE\*(:> \fIexpr\fP \*(<:FROM\*(:> \fIlist\fP\0
.TA
Remove one element from \fIlist\fP
.JT
\*(<:INSERT\*(:> \fIexpr\fP \*(<:IN\*(:> \fIlist\fP\0
.TA
Insert in right place
.JT
\*(<:DELETE\*(:> \fItarget\fP\0
.TA
Delete permanent target or table entry
.JT
\fIKEYWORD param KEYWORD\fP .\^.\^.
.TA
Execute user-defined command
.JT
\fIKEYWORD\fP
.TA
Execute refined command
.JT
\*(<:CHECK\*(:> \fItest\fP\0
.TA
Check \fItest\fP and stop if it fails
.JT
\*(<:IF\*(:> \fItest\fP\*(<::\*(:> \fIcommands\fP
.TA
If \fItest\fP succeeds, execute \fIcommands\fP; no \*(<:ELSE\*(:> allowed
.JT
\*(<:SELECT:\*(:>
.TA
Select one alternative:
.JT
\*(<:    \*(:>\fItest\fP\*(<::\*(:> \fIcommands\fP
.TA
\&     try each \fItest\fP in order
.JT
\*(<:    \*(:>.\^.\^.
.TA
\&     (one must succeed;
.JT
\*(<:    \*(:>\fItest\fP\*(<::\*(:> \fIcommands\fP\0
.TA
\&     the last \fItest\fP may be \*(<:ELSE\*(:>)
.JT
\*(<:WHILE\*(:> \fItest\fP\*(<::\*(:> \fIcommands\fP
.TA
Execute \fIcommands\fP, as long as \fItest\fP succeeds
.JT
\*(<:FOR\*(:> \fItag\fP\*(<:,\*(:>\^.\^.\^. \*(<:IN\*(:> \fItlt\fP\*(<::\*(:> \fIcommands\fP\0
.TA
Take each element of \fItlt\fP in turn
.HE "UNITS"
.IT
\*(<:HOW'TO\*(:> \fIKEYWORD\fP\ .\^.\^.\*(<::\*(:> \fIcommands\fP\0
.TA
Define new command \fIKEYWORD\fP\ .\^.\^.
.JT
\*(<:YIELD\*(:> \fIf\fP\*(<::\*(:> \fIcommands\fP\0
.TA
Define new function \fIf\fP with no arguments
.JT
\*(<:YIELD\*(:> \fIf x\fP\*(<::\*(:> \fIcommands\fP\0
.TA
Define new function \fIf\fP with one argument \fIx\fP
.JT
\*(<:YIELD\*(:> \fIx f y\fP\*(<::\*(:> \fIcommands\fP\0
.TA
Define new function \fIf\fP with two arguments \fIx\fP and \fIy\fP
.JT
\*(<:TEST\*(:> \fIpr\fP\*(<::\*(:> \fIcommands\fP\0
.TA
Define new predicate \fIpr\fP (succeeds/fails) with no arguments
.JT
\*(<:TEST\*(:> \fIpr x\fP\*(<::\*(:> \fIcommands\fP\0
.TA
Define new predicate \fIpr\fP with one argument \fIx\fP
.JT
\*(<:TEST\*(:> \fIx pr y\fP\*(<::\*(:> \fIcommands\fP\0
.TA
Define new predicate \fIpr\fP with two arguments \fIx\fP and \fIy\fP
.IT
\*(<:SHARE\*(:> \fItag\fP\*(<:,\*(:>.\^.\^.
.TA
Share permanent targets (before commands of unit)
.HE "Refinements" "(after the commands of a unit)"
.IT
\fIKEYWORD\fP \*(<::\*(:> \fIcommands\fP\0
.TA
Define command refinement
.JT
\fItag\fP\*(<::\*(:> \fIcommands\fP\0
.TA
Define expression or test refinement
.HE "Terminating commands" ""
.IT
\*(<:QUIT\*(:>\0
.TA
Leave \*(<:HOW'TO\*(:> or command refinement, or leave \*B
.JT
\*(<:RETURN\*(:> \fIexpr\fP\0
.TA
Leave \*(<:YIELD\*(:> or expression refinement and return value of \fIexpr\fP
.JT
\*(<:REPORT\*(:> \fItest\fP\0
.TA
Leave \*(<:TEST\*(:> or test refinement and report outcome of \fItest\fP
.JT
\*(<:SUCCEED\*(:>\0
.TA
The same, report success
.JT
\*(<:FAIL\*(:>\0
.TA
The same, report failure
.bp
.rs
.sp 2c
.HE "EXPRESSIONS AND TARGETS" ""
.IT
\*(<:666\*(:>, \*(<:3.14\*(:>\0
.TA
Exact constant
.IT
\*(<:2.93E8\*(:>,\  \*(<:3E+8\*(:>,\  \*(<:3.14E-9\*(:>\0
.TA
Approximate constant
.IT
\fIexpr\fP\*(<:,\*(:>\fIexpr\fP\*(<:,\*(:>\^.\^.\^.\0
.TA
Compound
.IT
\fItag\fP\*(<:,\*(:>\fItag\fP\*(<:,\*(:>\^.\^.\^.\0
.TA
Identifier (may also be used as target)
.IT
\fItext\fP\|\*(<:@\*(:>\|\fIp\fP\0
.TA
\&\*(<:"ABCD"@2 = "BCD"\*(:>
.\"Trimmed text, from \fIp\fP-th character on (also target)
.IT
\fItext\fP\*(<:|\*(:>\fIq\fP\0
.TA
\&\*(<:"ABCD"|3 = "ABC"\*(:>
.\"The same, first \fIq\fP characters (also target)
.IT
\fItext\fP\|\*(<:@\*(:>\|\fIp\fP\*(<:|\*(:>\fIq\fP\0
.TA
\&\*(<:"ABCD"@2|1 = "BCD"|1 = "B"\*(:>
.\"The same, from \fIp\fP-th on, first \fIq\fP characters (also target)
.IT
\fItable\fP\*(<:[\*(:>\fIexpr\fP\*(<:]\*(:>\0
.TA
Table selection (also target)
.IT
\&\*(<:"Jan"\*(:>,\  \*(<:"Feb"\*(:>,\  \*(<:"Won't!"\*(:>\0
.TA
Textual displays (empty: \*(<:""\*(:> or \*(<:''\*(:>)
.IT
\&\*(<:"value\ =\ `expr`;"\*(:>\0
.TA
Conversion of \*(<:expr\*(:> to text
.IT
\*(<:{1;\ 2;\ 2;\*(:>\ .\^.\^.\^\*(<:}\*(:>\0
.TA
List display (empty: \*(<:{}\*(:>)
.IT
\*(<:{1..10}\*(:>,\  \*(<:{'a'..'z'}\*(:>\0
.TA
List of consecutive values
.IT
\*(<:{['Jan']: 1; ['Feb']: 2; \*(:>.\^.\^.\^\*(<:}\*(:>\0
.TA
Table display (empty: \*(<:{}\*(:>)
.IT
\fIf\fP,\  \fIf x\fP,\  \fIx f y\fP\0
.TA
Result of \*(<:YIELD\*(:> \fIf\fP (no permanent effects)
.IT
\fItag\fP\0
.TA
Result of refinement (no permanent effects)
.HE "TESTS" ""
.IT
\fIx\fP \*(<:<\*(:> \fIy\fP,\  \fIx\fP \*(<:<=\*(:> \fIy\fP,\  \fIx\fP \*(<:>=\*(:> \fIy\fP,\  \fIx\fP \*(<:>\*(:> \fIy\fP\0
.TA
Order tests
.IT
\fIx\fP \*(<:=\*(:> \fIy\fP,\  \fIx\fP \*(<:<>\*(:> \fIy\fP
.TA
\&     (\*(<:<>\*(:> means `not equals';
.IT
\&\*(<:0\ <=\ d\ <\ 10\*(:>\0
.TA
\&     an exact number \fInever\fP equals an approximate one)
.IT
\fIpr\fP,\  \fIpr x\fP,\  \fIx pr y\fP\0
.TA
Result of \*(<:TEST\*(:> \fIpr\fP (no permanent effects)
.IT
\fItag\fP\0
.TA
Result of refinement (no permanent effects)
.IT
\fItest\fP\ \*(<:AND\*(:>\ \fItest\fP\ \*(<:AND\*(:>\ .\^.\^.\0
.TA
Fails as soon as one of the tests fails
.IT
\fItest\fP\ \*(<:OR\*(:>\ \fItest\fP\ \*(<:OR\*(:>\ .\^.\^.\0
.TA
Succeeds as soon as one of the tests succeeds
.IT
\*(<:NOT\*(:>\ \fItest\fP
.IT
\*(<:SOME\*(:> \fItag\fP\*(<:,\*(:>\^.\^.\^. \*(<:IN\*(:> \fItlt\fP \*(<:HAS\*(:> \fItest\fP\0
.TA
Sets \fItag\fP, .\^.\^. on success
.IT
\*(<:EACH\*(:> \fItag\fP\*(<:,\*(:>\^.\^.\^. \*(<:IN\*(:> \fItlt\fP \*(<:HAS\*(:> \fItest\fP\0
.TA
Sets \fItag\fP, .\^.\^. on failure
.IT
\*(<:NO\ \ \*(:> \fItag\fP\*(<:,\*(:>\^.\^.\^. \*(<:IN\*(:> \fItlt\fP \*(<:HAS\*(:> \fItest\fP\0
.TA
Sets \fItag\fP, .\^.\^. on failure
.IT
\*(<:SOME\*(:> \fItag\fP\*(<:,\*(:>\^.\^.\^. \*(<:PARSING\*(:> \fItext\fP \*(<:HAS\*(:> \fItest\fP\0
.TA
Sets \fItag\fP, .\^.\^. on success
.IT
\*(<:EACH\*(:> \fItag\fP\*(<:,\*(:>\^.\^.\^. \*(<:PARSING\*(:> \fItext\fP \*(<:HAS\*(:> \fItest\fP\0
.TA
Sets \fItag\fP, .\^.\^. on failure
.IT
\*(<:NO\ \ \*(:> \fItag\fP\*(<:,\*(:>\^.\^.\^. \*(<:PARSING\*(:> \fItext\fP \*(<:HAS\*(:> \fItest\fP\0
.TA
Sets \fItag\fP, .\^.\^. on failure
.bp
.rs
.sp 2c
.HE "PREDEFINED FUNCTIONS AND PREDICATES"
\fBFunctions on numbers\fP
.IT
\&\*(<:~\*(:>\fIx\fP\0
.TA
Approximate value of \fIx\fP
.IT
\*(<:+\*(:>\fIx\fP,\  \fIx\fP\*(<:+\*(:>\fIy\fP,\  \fIx\fP\*(<:-\*(:>\fIy\fP,\  \*(<:-\*(:>\fIx\fP,\  \fIx\fP\*(<:*\*(:>\fIy\fP,\  \fIx\fP\*(<:/\*(:>\fIy\fP
.IT
\fIx\fP\*(<:**\*(:>\fIy\fP\0
.TA
\fIx\fP raised to the power \fIy\fP
.IT
\fIn\fP\ \*(<:root\*(:>\ \fIx\fP,\  \*(<:root\*(:>\ \fIx\fP,\  \*(<:abs\*(:>\ \fIx\fP,\  \*(<:sign\*(:>\ \fIx\fP
.IT
\fIn\fP\ \*(<:round\*(:>\ \fIx\fP\0
.TA
\fIx\fP rounded to \fIn\fP digits after decimal point
.IT
\*(<:round\*(:>\ \fIx\fP,\ \*(<:floor\*(:>\ \fIx\fP,\  \*(<:ceiling\*(:>\ \fIx\fP
.TA
Rounded to whole number
.IT
\fIa\fP\ \*(<:mod\*(:>\ \fIn\fP\0
.TA
Remainder of \fIa\fP on division by \fIn\fP
.IT
\*(<:*/\*(:>\fIx\fP\0
.TA
Numerator of exact number \fIx\fP
.IT
\*(<:/*\*(:>\fIx\fP\0
.TA
Denominator
.IT
.in 0
\&\*(<:e\*(:>,\  \*(<:exp\*(:>\ \fIx\fP,\  \*(<:log\*(:>\ \fIx\fP,\  \fIb\fP\ \*(<:log\*(:>\ \fIx\fP
.IT
\*(<:pi\*(:>,\ \*(<:sin\*(:>\ \fIx\fP,\  \*(<:cos\*(:>\ \fIx\fP,\  \*(<:tan\*(:>\ \fIx\fP
.IT
\fIx\fP\ \*(<:atan\*(:>\ \fIy\fP,\  \*(<:atan\*(:>\ \fIx\fP
.HE "Functions on texts"
.IT
\fIt\fP\*(<:^\*(:>\fIu\fP\0
.TA
\fIt\fP and \fIu\fP joined into one text
.IT
\fIt\fP\*(<:^^\*(:>\fIn\fP\0
.TA
\fIt\fP repeated \fIn\fP times
.IT
\fIx\fP\*(<:<<\*(:>\fIn\fP\0
.TA
\fIx\fP converted\ to\ text\ and\ aligned\ left\ in\ field\ of\ width\ \fIn\fP
.IT
\fIx\fP\*(<:><\*(:>\fIn\fP\0
.TA
The same,\ centered
.IT
\fIx\fP\*(<:>>\*(:>\fIn\fP\0
.TA
The same, aligned right
.HE "Functions and predicates on texts, lists and tables"
.IT
\*(<:keys\*(:> \fItable\fP
.TA
List of all keys in \fItable\fP
.IT
\*(<:#\*(:>\fItlt\fP\0
.TA
Number of elements in \fItlt\fP
.IT
\fIe\fP\*(<:#\*(:>\fItlt\fP\0
.TA
Number of elements equal to \fIe\fP
.IT
\fIe\fP \*(<:in\*(:> \fItlt\fP,\  \fIe\fP \*(<:not'in\*(:> \fItlt\fP
.TA
Test for presence or absence
.IT
\*(<:min\*(:> \fItlt\fP\0
.TA
Smallest element of \fItlt\fP
.IT
\fIe\fP \*(<:min\*(:> \fItlt\fP\0
.TA
Smallest element larger than \fIe\fP
.IT
\*(<:max\*(:> \fItlt\fP,\  \fIe\fP \*(<:max\*(:> \fItlt\fP
.TA
Largest element
.IT
\fIn\fP \*(<:th'of\*(:> \fItlt\fP\0
.TA
\fIn\fP-th element
.HE "THE CHARACTERS"
.IT
\*(<: !"#$%&'()*+,-./\*(:>
.TA
This is the order of all characters
.JT
\*(<:0123456789:;<=>?\*(:>
.TA
that may occur in a text.
.JT
\*(<:@ABCDEFGHIJKLMNO\*(:>
.TA
(The first is a space.)
.JT
\*(<:PQRSTUVWXYZ[\\]^_\*(:>
.JT
\*(<:`abcdefghijklmno\*(:>
.JT
\*(<:pqrstuvwxyz{|}~\*(:>
.bp
.pl 0
.ch fo
