Skip to content

Commit fe4b38f

Browse files
jmdycktaradinoc
authored andcommitted
Add Appendix 3: Predefined Types (#45)
Add Appendix 3: Predefined Types Co-Authored-By: jmdyck <jmdyck@ibiblio.org>
1 parent c4240c8 commit fe4b38f

File tree

1 file changed

+79
-0
lines changed

1 file changed

+79
-0
lines changed
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# Appendix 3. Predefined Types
2+
3+
On these two pages is a table showing each of MDL's predefined `TYPE`s, its primitive type if
4+
different, and various flags: `S` for `STRUCTURED`, `E` for `EVALTYPE` not `QUOTE`, and `A` for `APPLICABLE`.
5+
6+
`X` means that an object of that `TYPE` cannot be `CHTYPE`d to and hence cannot be `READ` in (if
7+
attempted, a `CAN'T-CHTYPE-INTO` error is usual).
8+
9+
`B` means that an object of that `TYPE` cannot be `READ` in (if attempted, a `STORAGE-TYPES-DIFFER`
10+
error is usual), that instead it is built by the interpreter or `CHTYPE`d to by a program, and that its
11+
`PRINT`ed representation makes it look as though its `TYPEPRIM` were different.
12+
13+
`%` means that an object of that `TYPE` is `PRINT`ed using `%` notation and can be `READ` in only that way.
14+
15+
16+
| `TYPE` | `TYPEPRIM` | `S` | `E` | `A` | | comments |
17+
| ------ | ---------- | --- | --- | --- | ----- | -------- |
18+
| `ACTIVATION` | `FRAME` | | | | `X` | |
19+
| `ASOC` | | | | | `B` | sic: only one `S` |
20+
| `ATOM` | | | | | | |
21+
| `BITS` | `WORD` | | | | | |
22+
| `BYTES` | | `S` | | | | |
23+
| `CHANNEL` | `VECTOR` | `S` | | | `X` | |
24+
| `CHARACTER` | `WORD` | | | | | |
25+
| `CLOSURE` | `LIST` | `S` | | `A` | | |
26+
| `CODE` | `UVECTOR` | `S` | | | | |
27+
| `DECL` | `LIST` | `S` | | | | |
28+
| `DISMISS` | `ATOM` | | | | | can be returned by interrupt handler |
29+
| `ENVIRONMENT` | `FRAME` | | | | `B` | |
30+
| `FALSE` | `LIST` | `S` | | | | |
31+
| `FIX` | `WORD` | | | `A` | | |
32+
| `FLOAT` | `WORD` | | | | | |
33+
| `FORM` | `LIST` | `S` | `E` | | | |
34+
| `FRAME` | | | | | `B` | |
35+
| `FSUBR` | `WORD` | | | `A` | `X` | |
36+
| `FUNCTION` | `LIST` | `S` | | `A` | | |
37+
| `HANDLER` | `VECTOR` | `S` | | | `X` | |
38+
| `IHEADER` | `VECTOR` | `S` | | | `X` | "interrupt header" |
39+
| `ILLEGAL` | `WORD` | | | | `X` | Garbage collector may put this on non-`LEGAL?` object. |
40+
| `INTERNAL` | `INTERNAL-TYPE` | | | | `X` | should not be seen by programs |
41+
| `LINK` | `ATOM` | | | | `X` | for terminal shorthand |
42+
| `LIST` | | `S` | `E` | | | |
43+
| `LOCA` | | | | | `B` | locative to `TUPLE` |
44+
| `LOCAS` | | | | | `B` | locative to `ASOC` |
45+
| `LOCB` | | | | | `B` | locative to `BYTES` |
46+
| `LOCD` | | | | | `%` | locative to G/LVAL |
47+
| `LOCL` | | | | | `B` | locative to `LIST` |
48+
| `LOCR` | | | | | `%` | locative to `GVAL` in pure program |
49+
| `LOCS` | | | | | `B` | locative to `STRING` |
50+
| `LOCT` | | | | | `B` | locative to `TEMPLATE` |
51+
| `LOCU` | | | | | `B` | locative to `UVECTOR` |
52+
| `LOCV` | | | | | `B` | locative to `VECTOR` |
53+
| `LOSE` | `WORD` | | | | | a place holder |
54+
| `MACRO` | `LIST` | `S` | | `A` | | |
55+
| `OBLIST` | `UVECTOR` | `S` | | | `X` | |
56+
| `OFFSET` | `OFFSET` | | | `A` | `%` | |
57+
| `PCODE` | `WORD` | | | | `%` | "pure code" |
58+
| `PRIMTYPE-C` | `WORD` | | | | `%` | "primtype code" |
59+
| `PROCESS` | | | | | `B` | |
60+
| `QUICK-ENTRY` | `VECTOR` | `S` | | `A` | `%` | an `RSUBR-ENTRY` that has been `QCALL`ed and `RSUBR-LINK`ed |
61+
| `QUICK-RSUBR` | `VECTOR` | `S` | | `A` | `%/B` | an `RSUBR` that has been `QCALL`ed and `RSUBR-LINK`ed |
62+
| `READA` | `FRAME` | | | | `X` | in eof slot during recursive `READ` via `READ-TABLE` |
63+
| `RSUBR` | `VECTOR` | `S` | | `A` | `%/B` | if code vector is pure/impure, respectively |
64+
| `RSUBR-ENTRY` | `VECTOR` | `S` | | `A` | `%` | |
65+
| `SEGMENT` | `LIST` | `S` | `E` | | | |
66+
| `SPLICE` | `LIST` | `S` | | | | for returning many things via `READ-TABLE` |
67+
| `STORAGE` | | `S` | | | | If possible, use `FREEZE` `SUBR` instead. |
68+
| `STRING` | | `S` | | | | |
69+
| `SUBR` | `WORD` | | | `A` | `X` | |
70+
| `TAG` | `VECTOR` | `S` | | | `X` | for non-local `GO`s |
71+
| `TEMPLATE` | | `S` | | | `B` | The interpreter itself can't build one. See Lebling (1979). |
72+
| `TIME` | `WORD` | | | | | used internally to identify `FRAME`s |
73+
| `TUPLE` | | `S` | | | `B` | vector on the control stack |
74+
| `TYPE-C` | `WORD` | | | | `%` | "type code" |
75+
| `TYPE-W` | `WORD` | | | | `%` | "type word" |
76+
| `UNBOUND` | `WORD` | | | | `X` | value of unassigned but bound `ATOM`, as seen by locatives |
77+
| `UVECTOR` | | `S` | `E` | | | "uniform vector" |
78+
| `VECTOR` | | `S` | `E` | | | |
79+
| `WORD` | | | | | | |

0 commit comments

Comments
 (0)