-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathellispnotes
70 lines (57 loc) · 1.16 KB
/
ellispnotes
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
bindings:
(let five 5)
(let ten 10)
named function def choices bindings:
(let (add x y) (+ x y)) => can wrap into existing stuff
nameless function def choices:
(fn (x y) (+ x y)) => can wrap into existing stuff
operators:
(== 10 10)
(!= 10 10)
(< 5 (> 10 5))
(!true)
(- 5)
literals:
-5 => this should not be a function call.
We can do this in the parser (under parseInfixExpression)?
5
"joshua pepple"
true
false
'() => need to impl NIL in lexer
[1, 2, 3, 4]
{"1": 1, "2": 2}
(list 1 2 3) => need to impl cons and list
(fn (x): x)
(cons 1 '()) => need to impl cons and list
'(1 2 3 4)
func calls:
(let res (add five ten))
conds:
(if (< 5 10): true (+ 1 2), false)
considerations:
atoms:
'someAtom
'someAtom != "someAtom" == true
=> need atom table (dictionary?) and parser handling
arrays and hashmaps:
[1, 2, 3, 4] == [1 2 3 4]
{
1: 1
2: 2
} ==
{
1: 1,
2: 2,
}
=> conditionally advance to next token in parser if cur token after
current value is a comma
this allows space to be a separator instead of space+comma
conds:
(cond
:(checkA) (doStuff)
:(checkB) (doStuff)
:(checkC) (doStuff),
true (doStuff))
array indexing:
|array index|