The pymdl book

Appendix B. The TYPEs

B.1 Types available in pymdl

<ALLTYPES> of a fresh pymdl, each with its PRIMTYPE and, where the built-in type census carries one, the MDL 55 type code (octal) -- the number a compiled RSUBR sees in the left half of a type word. Generated by tools/book_gen.py; 66 types. The vector is MDL 55's own order -- element k+1 is the TYPE with code k, the built-ins first -- and the codes no TYPE is named for hold the ATOM INTERNAL, left out here.

TYPE PRIMTYPE era code
LOSE WORD 0
FIX WORD 1
FLOAT WORD 2
CHARACTER WORD 3
SUBR WORD 5
FSUBR WORD 6
UNBOUND WORD 7
ILLEGAL WORD 11
TIME WORD 12
LIST LIST 13
FORM LIST 14
SEGMENT LIST 15
FUNCTION LIST 16
CLOSURE LIST 17
LOCL LOCL 20
FALSE LIST 21
UVECTOR UVECTOR 23
OBLIST UVECTOR 24
VECTOR VECTOR 25
CHANNEL VECTOR 26
LOCV LOCV 27
TAG VECTOR 32
PROCESS PROCESS 33
MACRO LIST 40
TUPLE TUPLE 42
FRAME FRAME 45
STRING STRING 46
ATOM ATOM 47
LOCD LOCD 50
BYTES BYTES 51
ENVIRONMENT FRAME 52
ACTIVATION FRAME 53
ASOC ASOC 54
LOCU LOCU 55
LOCS LOCS 56
LOCA LOCA 57
TEMPLATE TEMPLATE 61
LOCT LOCT 62
LOCR LOCR 63
QUICK-RSUBR VECTOR 65
QUICK-ENTRY VECTOR 66
WORD WORD 70
RSUBR VECTOR 71
CODE UVECTOR 72
PRIMTYPE-C WORD 73
BITS WORD 74
STORAGE STORAGE 75
PICTURE STORAGE 76
LINK ATOM 100
IHEADER VECTOR 101
HANDLER VECTOR 102
LOCAS LOCAS 103
DECL LIST 104
DISMISS ATOM 105
RSUBR-ENTRY VECTOR 107
SPLICE LIST 110
PCODE WORD 111
TYPE-W WORD 112
TYPE-C WORD 113
READA FRAME 115
LOCB LOCB 120
OFFSET OFFSET 122
PYCODE WORD
DATA-BASE!-LIB VECTOR
CURSOR!-IEDIT VECTOR
BREAK LIST

B.2 Type behavior and representation

The following classification records the predefined types of the historical interpreter, including evaluation, application, and reading restrictions. It complements the current type census above. The type facilities and pymdl differences are explained in chapter 9; structures are covered in chapter 10.

On these two pages is a table showing each of MDL's predefined TYPEs, its primitive type if different, and various flags: S for STRUCTURED, E for EVALTYPE not QUOTE, and A for APPLICABLE.

X means that an object of that TYPE cannot be CHTYPEd to and hence cannot be READ in (if attempted, a CAN'T-CHTYPE-INTO error is usual).

B means that an object of that TYPE cannot be READ in (if attempted, a STORAGE-TYPES-DIFFER error is usual), that instead it is built by the interpreter or CHTYPEd to by a program, and that its PRINTed representation makes it look as though its TYPEPRIM were different.

% means that an object of that TYPE is PRINTed using % notation and can be READ in only that way.

TYPE TYPEPRIM S E A comments
ACTIVATION FRAME X
ASOC B sic: only one S
ATOM
BITS WORD
BYTES S
CHANNEL VECTOR S X
CHARACTER WORD
CLOSURE LIST S A
CODE UVECTOR S
DECL LIST S
DISMISS ATOM can be returned by interrupt handler
ENVIRONMENT FRAME B
FALSE LIST S
FIX WORD A
FLOAT WORD
FORM LIST S E
FRAME B
FSUBR WORD A X
FUNCTION LIST S A
HANDLER VECTOR S X
IHEADER VECTOR S X "interrupt header"
ILLEGAL WORD X Garbage collector may put this on non-LEGAL? object.
INTERNAL INTERNAL-TYPE X should not be seen by programs
LINK ATOM X for terminal shorthand
LIST S E
LOCA B locative to TUPLE
LOCAS B locative to ASOC
LOCB B locative to BYTES
LOCD % locative to G/LVAL
LOCL B locative to LIST
LOCR % locative to GVAL in pure program
LOCS B locative to STRING
LOCT B locative to TEMPLATE
LOCU B locative to UVECTOR
LOCV B locative to VECTOR
LOSE WORD a place holder
MACRO LIST S A
OBLIST UVECTOR S X
OFFSET OFFSET A %
PCODE WORD % "pure code"
PRIMTYPE-C WORD % "primtype code"
PROCESS B
QUICK-ENTRY VECTOR S A % an RSUBR-ENTRY that has been QCALLed and RSUBR-LINKed
QUICK-RSUBR VECTOR S A %/B an RSUBR that has been QCALLed and RSUBR-LINKed
READA FRAME X in eof slot during recursive READ via READ-TABLE
RSUBR VECTOR S A %/B if code vector is pure/impure, respectively
RSUBR-ENTRY VECTOR S A %
SEGMENT LIST S E
SPLICE LIST S for returning many things via READ-TABLE
STORAGE S If possible, use FREEZE SUBR instead.
STRING S
SUBR WORD A X
TAG VECTOR S X for non-local GOs
TEMPLATE S B Built with the TEMPLATE package; see chapter 31.
TIME WORD used internally to identify FRAMEs
TUPLE S B vector on the control stack
TYPE-C WORD % "type code"
TYPE-W WORD % "type word"
UNBOUND WORD X value of unassigned but bound ATOM, as seen by locatives
UVECTOR S E "uniform vector"
VECTOR S E
WORD