.\" Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985.
\*(BB\fB\ \|QUICK REFERENCE\fP
Enter \*B system, using editor \fI$EDITOR\fP (default \fIvi\fP)
\*(<:b \*(:>\|\fIfile\fP .\^.\^.
Execute \*B commands in named files, and \*(<:QUIT\*(:>
Print all units in workspace on printer; do not enter \*B system
Print (list) all units on screen; do not enter \*B system
\*(<:b -i \*(:>\fItable\fP
Create a table of texts from the standard input
\*(<:b -o \*(:>\fItable\fP
Write a table of texts to the standard output
.HE "WHAT IS IN THE WORKSPACE ?" " (only as immediate commands)"
Display tags of current permanent targets
Display headings of current units
.HE "HOW TO MAKE CHANGES"
\*(<::\*(:>\fIunit-name\fP\0
Make changes to unit (default: unit last referred to)
\*(<:=\*(:>\fItarget-name\fP
Make changes to contents of target (last so changed)
.de KK \"Key(s) that preceeding name of editing operation is bound to
\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'
.de DD \"Description of editing operation
Move focus to first contained item
Move focus to last contained item
Extend focus (usually to the right)
Move focus to whole of line above
Move focus to previous item
Move focus to whole of line below
Make new hole, move focus up
Make new hole, move focus down
Make new hole, move focus left
Make new hole, move focus right
.HE "Typing and making changes"
Insert character before focus
Accept suggestion, focus to next hole or end of line
Go to new line, or decrease indentation
Undo effect of last key pressed (may be repeated)
Redo last UNDOne key (may be repeated)
Delete contents of focus (to buffer)
Copy contents of focus to buffer, or buffer to hole
Start/stop recording keystrokes
Play back recorded keystrokes
Finish changes or execute command
Leave incomplete unit or interrupt command execution
.HE "COMMANDS" " (\fItlt\fP is text, list or table)"
\*(<:WRITE\*(:> \fIexpr\fP\0
Write to terminal; \*(<:/\*(:> before or after \fIexpr\fP gives new line
\*(<:READ\*(:> \fItarget\fP \*(<:EG\*(:> \fIexpr\fP\0
Read expression from terminal to \fItarget\fP; \fIexpr\fP is example
\*(<:READ\*(:> \fItarget\fP \*(<:RAW\*(:>\0
\*(<:PUT\*(:> \fIexpr\fP \*(<:IN\*(:> \fItarget\fP
Put value of \fIexpr\fP in \fItarget\fP
\*(<:DRAW\*(:> \fItarget\fP\0
Random number from \*(<:~0\*(:> up to, but not including, \*(<:~1\*(:>
\*(<:CHOOSE\*(:> \fItarget\fP \*(<:FROM\*(:> \fItlt\fP\0
Random element of \fItlt\fP
\*(<:SET'RANDOM\*(:> \fIexpr\fP\0
Start random sequence for \*(<:DRAW\*(:> and \*(<:CHOOSE\*(:>
\*(<:REMOVE\*(:> \fIexpr\fP \*(<:FROM\*(:> \fIlist\fP\0
Remove one element from \fIlist\fP
\*(<:INSERT\*(:> \fIexpr\fP \*(<:IN\*(:> \fIlist\fP\0
\*(<:DELETE\*(:> \fItarget\fP\0
Delete permanent target or table entry
\fIKEYWORD param KEYWORD\fP .\^.\^.
Execute user-defined command
\*(<:CHECK\*(:> \fItest\fP\0
Check \fItest\fP and stop if it fails
\*(<:IF\*(:> \fItest\fP\*(<::\*(:> \fIcommands\fP
If \fItest\fP succeeds, execute \fIcommands\fP; no \*(<:ELSE\*(:> allowed
\*(<: \*(:>\fItest\fP\*(<::\*(:> \fIcommands\fP
\& try each \fItest\fP in order
\*(<: \*(:>\fItest\fP\*(<::\*(:> \fIcommands\fP\0
\& the last \fItest\fP may be \*(<:ELSE\*(:>)
\*(<:WHILE\*(:> \fItest\fP\*(<::\*(:> \fIcommands\fP
Execute \fIcommands\fP, as long as \fItest\fP succeeds
\*(<:FOR\*(:> \fItag\fP\*(<:,\*(:>\^.\^.\^. \*(<:IN\*(:> \fItlt\fP\*(<::\*(:> \fIcommands\fP\0
Take each element of \fItlt\fP in turn
\*(<:HOW'TO\*(:> \fIKEYWORD\fP\ .\^.\^.\*(<::\*(:> \fIcommands\fP\0
Define new command \fIKEYWORD\fP\ .\^.\^.
\*(<:YIELD\*(:> \fIf\fP\*(<::\*(:> \fIcommands\fP\0
Define new function \fIf\fP with no arguments
\*(<:YIELD\*(:> \fIf x\fP\*(<::\*(:> \fIcommands\fP\0
Define new function \fIf\fP with one argument \fIx\fP
\*(<:YIELD\*(:> \fIx f y\fP\*(<::\*(:> \fIcommands\fP\0
Define new function \fIf\fP with two arguments \fIx\fP and \fIy\fP
\*(<:TEST\*(:> \fIpr\fP\*(<::\*(:> \fIcommands\fP\0
Define new predicate \fIpr\fP (succeeds/fails) with no arguments
\*(<:TEST\*(:> \fIpr x\fP\*(<::\*(:> \fIcommands\fP\0
Define new predicate \fIpr\fP with one argument \fIx\fP
\*(<:TEST\*(:> \fIx pr y\fP\*(<::\*(:> \fIcommands\fP\0
Define new predicate \fIpr\fP with two arguments \fIx\fP and \fIy\fP
\*(<:SHARE\*(:> \fItag\fP\*(<:,\*(:>.\^.\^.
Share permanent targets (before commands of unit)
.HE "Refinements" "(after the commands of a unit)"
\fIKEYWORD\fP \*(<::\*(:> \fIcommands\fP\0
Define command refinement
\fItag\fP\*(<::\*(:> \fIcommands\fP\0
Define expression or test refinement
.HE "Terminating commands" ""
Leave \*(<:HOW'TO\*(:> or command refinement, or leave \*B
\*(<:RETURN\*(:> \fIexpr\fP\0
Leave \*(<:YIELD\*(:> or expression refinement and return value of \fIexpr\fP
\*(<:REPORT\*(:> \fItest\fP\0
Leave \*(<:TEST\*(:> or test refinement and report outcome of \fItest\fP
.HE "EXPRESSIONS AND TARGETS" ""
\*(<:666\*(:>, \*(<:3.14\*(:>\0
\*(<:2.93E8\*(:>,\ \*(<:3E+8\*(:>,\ \*(<:3.14E-9\*(:>\0
\fIexpr\fP\*(<:,\*(:>\fIexpr\fP\*(<:,\*(:>\^.\^.\^.\0
\fItag\fP\*(<:,\*(:>\fItag\fP\*(<:,\*(:>\^.\^.\^.\0
Identifier (may also be used as target)
\fItext\fP\|\*(<:@\*(:>\|\fIp\fP\0
\&\*(<:"ABCD"@2 = "BCD"\*(:>
.\"Trimmed text, from \fIp\fP-th character on (also target)
\fItext\fP\*(<:|\*(:>\fIq\fP\0
\&\*(<:"ABCD"|3 = "ABC"\*(:>
.\"The same, first \fIq\fP characters (also target)
\fItext\fP\|\*(<:@\*(:>\|\fIp\fP\*(<:|\*(:>\fIq\fP\0
\&\*(<:"ABCD"@2|1 = "BCD"|1 = "B"\*(:>
.\"The same, from \fIp\fP-th on, first \fIq\fP characters (also target)
\fItable\fP\*(<:[\*(:>\fIexpr\fP\*(<:]\*(:>\0
Table selection (also target)
\&\*(<:"Jan"\*(:>,\ \*(<:"Feb"\*(:>,\ \*(<:"Won't!"\*(:>\0
Textual displays (empty: \*(<:""\*(:> or \*(<:''\*(:>)
\&\*(<:"value\ =\ `expr`;"\*(:>\0
Conversion of \*(<:expr\*(:> to text
\*(<:{1;\ 2;\ 2;\*(:>\ .\^.\^.\^\*(<:}\*(:>\0
List display (empty: \*(<:{}\*(:>)
\*(<:{1..10}\*(:>,\ \*(<:{'a'..'z'}\*(:>\0
List of consecutive values
\*(<:{['Jan']: 1; ['Feb']: 2; \*(:>.\^.\^.\^\*(<:}\*(:>\0
Table display (empty: \*(<:{}\*(:>)
\fIf\fP,\ \fIf x\fP,\ \fIx f y\fP\0
Result of \*(<:YIELD\*(:> \fIf\fP (no permanent effects)
Result of refinement (no permanent effects)
\fIx\fP \*(<:<\*(:> \fIy\fP,\ \fIx\fP \*(<:<=\*(:> \fIy\fP,\ \fIx\fP \*(<:>=\*(:> \fIy\fP,\ \fIx\fP \*(<:>\*(:> \fIy\fP\0
\fIx\fP \*(<:=\*(:> \fIy\fP,\ \fIx\fP \*(<:<>\*(:> \fIy\fP
\& (\*(<:<>\*(:> means `not equals';
\&\*(<:0\ <=\ d\ <\ 10\*(:>\0
\& an exact number \fInever\fP equals an approximate one)
\fIpr\fP,\ \fIpr x\fP,\ \fIx pr y\fP\0
Result of \*(<:TEST\*(:> \fIpr\fP (no permanent effects)
Result of refinement (no permanent effects)
\fItest\fP\ \*(<:AND\*(:>\ \fItest\fP\ \*(<:AND\*(:>\ .\^.\^.\0
Fails as soon as one of the tests fails
\fItest\fP\ \*(<:OR\*(:>\ \fItest\fP\ \*(<:OR\*(:>\ .\^.\^.\0
Succeeds as soon as one of the tests succeeds
\*(<:NOT\*(:>\ \fItest\fP
\*(<:SOME\*(:> \fItag\fP\*(<:,\*(:>\^.\^.\^. \*(<:IN\*(:> \fItlt\fP \*(<:HAS\*(:> \fItest\fP\0
Sets \fItag\fP, .\^.\^. on success
\*(<:EACH\*(:> \fItag\fP\*(<:,\*(:>\^.\^.\^. \*(<:IN\*(:> \fItlt\fP \*(<:HAS\*(:> \fItest\fP\0
Sets \fItag\fP, .\^.\^. on failure
\*(<:NO\ \ \*(:> \fItag\fP\*(<:,\*(:>\^.\^.\^. \*(<:IN\*(:> \fItlt\fP \*(<:HAS\*(:> \fItest\fP\0
Sets \fItag\fP, .\^.\^. on failure
\*(<:SOME\*(:> \fItag\fP\*(<:,\*(:>\^.\^.\^. \*(<:PARSING\*(:> \fItext\fP \*(<:HAS\*(:> \fItest\fP\0
Sets \fItag\fP, .\^.\^. on success
\*(<:EACH\*(:> \fItag\fP\*(<:,\*(:>\^.\^.\^. \*(<:PARSING\*(:> \fItext\fP \*(<:HAS\*(:> \fItest\fP\0
Sets \fItag\fP, .\^.\^. on failure
\*(<:NO\ \ \*(:> \fItag\fP\*(<:,\*(:>\^.\^.\^. \*(<:PARSING\*(:> \fItext\fP \*(<:HAS\*(:> \fItest\fP\0
Sets \fItag\fP, .\^.\^. on failure
.HE "PREDEFINED FUNCTIONS AND PREDICATES"
\fBFunctions on numbers\fP
Approximate value of \fIx\fP
\*(<:+\*(:>\fIx\fP,\ \fIx\fP\*(<:+\*(:>\fIy\fP,\ \fIx\fP\*(<:-\*(:>\fIy\fP,\ \*(<:-\*(:>\fIx\fP,\ \fIx\fP\*(<:*\*(:>\fIy\fP,\ \fIx\fP\*(<:/\*(:>\fIy\fP
\fIx\fP\*(<:**\*(:>\fIy\fP\0
\fIx\fP raised to the power \fIy\fP
\fIn\fP\ \*(<:root\*(:>\ \fIx\fP,\ \*(<:root\*(:>\ \fIx\fP,\ \*(<:abs\*(:>\ \fIx\fP,\ \*(<:sign\*(:>\ \fIx\fP
\fIn\fP\ \*(<:round\*(:>\ \fIx\fP\0
\fIx\fP rounded to \fIn\fP digits after decimal point
\*(<:round\*(:>\ \fIx\fP,\ \*(<:floor\*(:>\ \fIx\fP,\ \*(<:ceiling\*(:>\ \fIx\fP
\fIa\fP\ \*(<:mod\*(:>\ \fIn\fP\0
Remainder of \fIa\fP on division by \fIn\fP
Numerator of exact number \fIx\fP
\&\*(<:e\*(:>,\ \*(<:exp\*(:>\ \fIx\fP,\ \*(<:log\*(:>\ \fIx\fP,\ \fIb\fP\ \*(<:log\*(:>\ \fIx\fP
\*(<:pi\*(:>,\ \*(<:sin\*(:>\ \fIx\fP,\ \*(<:cos\*(:>\ \fIx\fP,\ \*(<:tan\*(:>\ \fIx\fP
\fIx\fP\ \*(<:atan\*(:>\ \fIy\fP,\ \*(<:atan\*(:>\ \fIx\fP
\fIt\fP\*(<:^\*(:>\fIu\fP\0
\fIt\fP and \fIu\fP joined into one text
\fIt\fP\*(<:^^\*(:>\fIn\fP\0
\fIt\fP repeated \fIn\fP times
\fIx\fP\*(<:<<\*(:>\fIn\fP\0
\fIx\fP converted\ to\ text\ and\ aligned\ left\ in\ field\ of\ width\ \fIn\fP
\fIx\fP\*(<:><\*(:>\fIn\fP\0
\fIx\fP\*(<:>>\*(:>\fIn\fP\0
.HE "Functions and predicates on texts, lists and tables"
\*(<:keys\*(:> \fItable\fP
List of all keys in \fItable\fP
Number of elements in \fItlt\fP
\fIe\fP\*(<:#\*(:>\fItlt\fP\0
Number of elements equal to \fIe\fP
\fIe\fP \*(<:in\*(:> \fItlt\fP,\ \fIe\fP \*(<:not'in\*(:> \fItlt\fP
Test for presence or absence
\*(<:min\*(:> \fItlt\fP\0
Smallest element of \fItlt\fP
\fIe\fP \*(<:min\*(:> \fItlt\fP\0
Smallest element larger than \fIe\fP
\*(<:max\*(:> \fItlt\fP,\ \fIe\fP \*(<:max\*(:> \fItlt\fP
\fIn\fP \*(<:th'of\*(:> \fItlt\fP\0
\*(<: !"#$%&'()*+,-./\*(:>
This is the order of all characters
\*(<:0123456789:;<=>?\*(:>
that may occur in a text.
\*(<:@ABCDEFGHIJKLMNO\*(:>
\*(<:PQRSTUVWXYZ[\\]^_\*(:>
\*(<:`abcdefghijklmno\*(:>
\*(<:pqrstuvwxyz{|}~\*(:>