02 The language surface
Roughly 60 verbs, 50 functions, 30 mnemonics.
Below is a scannable sample of what's implemented, so you can go looking for the specific thing
you're worried about. If it isn't listed, that means it isn't in this sample — not that it
isn't implemented. The parser answers the question properly in an afternoon.
~60
Verbs
Control flow, program flow, file declaration and file I/O. A sample of the
implemented set:
- LET
- PRINT
- INPUT
- READ
- WRITE
- EXTRACT
- FIND
- REMOVE
- OPEN
- CLOSE
- ERASE
- DIM
- IF
- THEN
- ELSE
- ENDIF
- FOR
- NEXT
- WHILE
- WEND
- GOTO
- GOSUB
- RETURN
- ON
- SWITCH
- CASE
- SWEND
- CALL
- ENTER
- EXIT
- EXITTO
- ESCAPE
- SETERR
- RETRY
- STOP
- END
- RUN
- PRECISION
- LOCK
- UNLOCK
- BEGIN
- CLEAR
- RELEASE
- WAIT
- DIRECT
- INDEXED
- SERIAL
- STRING
- SORT
- RENAME
~50
Functions
String, numeric, conversion, bitwise, and the file and key introspection
functions your utilities lean on:
- STR()
- NUM()
- LEN()
- POS()
- FILL()
- PAD()
- CVS()
- DEC()
- BIN()
- ATH()
- HTA()
- MSK()
- NOT()
- AND()
- OR()
- XOR()
- MOD()
- ABS()
- INT()
- SQR()
- SGN()
- MIN()
- MAX()
- RND()
- DATE()
- TCB()
- FIN()
- FID()
- IND()
- LST()
- KEY()
- KEYF()
- KEYL()
- KEYN()
- KEYP()
~30
Terminal mnemonics
Passed through raw by the incumbent, so these are an interface rather than an
implementation detail. Cursor addressing, clearing, attributes, color, line draw and
windows:
- '@(c,r)'
- 'CS'
- 'CL'
- 'CE'
- 'CR'
- 'LF'
- 'BR'
- 'ER'
- 'BU'
- 'EU'
- 'BB'
- 'EB'
- 'SB'
- 'SF'
- 'LD'
- 'LE'
- 'WINDOW'
- 'POP'
- 'SCROLL'
I/O
The I/O option set
The options that turn a read into control flow. All of them branch and behave
the way the incumbent does, including a branch to a line number that doesn't exist rounding
up to the next one that does:
- KEY=
- DOM=
- ERR=
- END=
- SIZ=
- TIM=
- SRT=
- TBL=
File types: multi-level B-tree keyed files, fixed-record
direct files, serial and string files — all opened in place, in their existing format, with
their existing keys and their existing alternate key segments.
Alternate keys, descending key segments, segment offsets
and padding are handled the way each file's own header describes them, not the way the manual
summarises them. A wrong alternate key doesn't crash anything — it quietly finds the wrong
record — so this is one of the places we test hardest.