-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathepisode1-5.txt
42 lines (33 loc) · 1.41 KB
/
episode1-5.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
Fifth episode! I'm building a programming language/environment from scratch while recording myself. Watch me struggle figuring out the bootstrapping! I finally get to write some javascript to get things going. Today, I play Deadmau's Random Album Title (at zero volume to avoid copyright infringement...).
github.com/altocodenl/cell
- Rather than saying "set", I'm going to say "put".
verbs 1 get
2 put
@ foo
= bar
@ put foo bar
= bar
call 1 "receive message"
2 "parse it into either a get or put call"
3 "if the message is not a valid call, return ""ERROR"""
4 "get localstorage"
5 "if it's put, update localstorage"
6 "if it's get, return the value"
7 "if it's put, return ""OK"""
For now, let's go with single line
"test cases" invalid 1 message whatevs
= "Call must start with ""@@"""
2 message @get
= "Call must start with ""@"" and have a space after it"
3 message "@ get " "
= "You opened a quote that you forgot to close"
"valid gets" 1 message @
= "the whole thing"
2 message @ foo
= "get whatever is at foo"
3 message "@ foo"
= "get whatever is at foo"
"valid puts" ...
var makeCall = function (message) {
// @
}