-
Notifications
You must be signed in to change notification settings - Fork 5
/
thought.txt
56 lines (40 loc) · 1.68 KB
/
thought.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
add ctx to toString -- This is hard because you need a context for each symbol
and variable type the thing can depend on. Also this would add a dependency on
contexts to the generated code, but maybe having Var.Dict is a good idea anyway.
Respect user's choice of order as much as possible.
Add all (or just more) sml primitive types as builtins
(unit, int, word, real, char, string, substring, vector, bool, option, order).
Define what it means for an abt spec to be well-formed, and make parser/analysis
check that, then fix internal names:
check that things are applied to the right number of arguments
names must start with a letter and may include letters, numbers, and _
this means any sml name, except that ' is disallowed
??? allow symbol names like ">>" ???
??? allow infix operators ???
Reserved words:
Abbot
sort
abt, Abt
symbol, Symbol
list
view
into
out
aequiv
map
subst ^ anything
iter ??? might not be necessary to restrict this
all sml reserved words and restricted identifiers
all opers in the same sort or abt must be unique, but the same oper can be
duplicated across asts and abts
sorts and abts may refer to sorts, abts, and symbols
symbol, abt, and sort names must be unique and mutually exclusive, up to
capitalization
abt applications must use the correct aritys
type parameters used in abt declaration must be in the arguments of that ast
okay names include: var, variable, sym, t, temp, exp_oper,
names can be concatenation of other names
??? restrict use of Ops or something ???
??? what happens when names end in numbers ???
convention for variable names: internal names end in "'", names generated from
the user's names are the user's name followed by "'", followed by a number