3 ["def", "_path", ["require", ["`", "path"]]],
5 ["def", "_node_readline", ["require", [".", "_path", ["`", "resolve"],
7 ["`", "node_readline.js"]]]],
9 ["def", "div", ["fn", ["a", "b"], ["parseInt", ["/", "a", "b"]]]],
11 ["def", "time-ms", ["fn", [],
12 [".", ["new", "Date"], ["`", "getTime"]]]],
15 ["def", "assoc", ["fn", ["src-hm", "&", "kvs"],
16 ["let", ["hm", ["clone", "src-hm"]],
17 ["assocs!", "hm", "kvs"]]]],
19 ["def", "dissoc", ["fn", ["src-hm", "&", "ks"],
20 ["let", ["hm", ["clone", "src-hm"]],
22 ["map", ["fn", ["k"], ["del", "hm", "k"]], "ks"],
25 ["def", "_get", ["fn", ["obj", "key"],
26 ["if", ["nil?", "obj"],
28 ["if", ["contains?", "obj", "key"],
29 ["get", "obj", "key"],
32 ["def", "_count", ["fn", ["a"],
33 ["if", ["=", null, "a"],
37 ["def", "_nth", ["fn", ["seq", "idx"],
38 ["if", [">=", "idx", ["count", "seq"]],
39 ["throw", "nth: index out of range"],
40 ["nth", "seq", "idx"]]]],
42 ["def", "_first", ["fn", ["seq"],
43 ["if", ["empty?", "seq"],
47 ["def", "_apply", ["fn", ["f", "&", "args"],
48 ["let", ["fn", ["if", ["malfunc?", "f"], ["get", "f", ["`", "fn"]], "f"],
49 "fargs", ["concat", ["slice", "args", 0, ["-", ["count", "args"], 1]],
50 ["nth", "args", ["-", ["count", "args"], 1]]]],
51 ["apply", "fn", "fargs"]]]],
53 ["def", "_map", ["fn", ["f", "seq"],
54 ["let", ["fn", ["if", ["malfunc?", "f"], ["get", "f", ["`", "fn"]], "f"]],
55 ["map", "fn", "seq"]]]],
57 ["def", "with_meta", ["fn", ["obj", "m"],
58 ["let", ["new-obj", ["clone", "obj"]],
60 ["set", "new-obj", ["`", "__meta__"], "m"],
63 ["def", "meta", ["fn", ["obj"],
64 ["if", ["or", ["sequential?", "obj"],
67 ["if", ["contains?", "obj", ["`", "__meta__"]],
68 ["get", "obj", ["`", "__meta__"]],
72 ["def", "reset!", ["fn", ["atm", "val"],
73 ["set", "atm", ["`", "val"], "val"]]],
75 ["def", "swap!", ["fn", ["atm", "f", "&", "args"],
76 ["let", ["fn", ["if", ["malfunc?", "f"], ["get", "f", ["`", "fn"]], "f"],
77 "fargs", ["cons", ["get", "atm", ["`", "val"]], "args"],
78 "val", ["apply", "fn", "fargs"]],
80 ["set", "atm", ["`", "val"], "val"],
86 ["`", "throw"], "throw",
88 ["`", "nil?"], "nil?",
89 ["`", "true?"], "true?",
90 ["`", "false?"], "false?",
91 ["`", "symbol"], "symbol",
92 ["`", "symbol?"], "symbol?",
93 ["`", "keyword"], "keyword",
94 ["`", "keyword?"], "keyword?",
96 ["`", "pr-str"], ["fn", ["&", "a"], ["pr-list", "a", true, ["`", " "]]],
97 ["`", "str"], ["fn", ["&", "a"], ["pr-list", "a", false, ["`", ""]]],
98 ["`", "prn"], ["fn", ["&", "a"],
100 ["println", ["pr-list", "a", true, ["`", " "]]],
102 ["`", "println"], ["fn", ["&", "a"],
104 ["println", ["pr-list", "a", false, ["`", " "]]],
106 ["`", "read-string"], "read-str",
107 ["`", "readline"], ["fn", ["p"],
108 [".", "_node_readline", ["`", "readline"], "p"]],
109 ["`", "slurp"], "slurp",
119 ["`", "time-ms"], "time-ms",
121 ["`", "list"], "list",
122 ["`", "list?"], "list?",
123 ["`", "vector"], "vector",
124 ["`", "vector?"], "vector?",
125 ["`", "hash-map"], "hash-map",
126 ["`", "assoc"], "assoc",
127 ["`", "dissoc"], "dissoc",
128 ["`", "map?"], "map?",
129 ["`", "get"], "_get",
130 ["`", "contains?"], "contains?",
131 ["`", "keys"], "keys",
132 ["`", "vals"], "vals",
134 ["`", "sequential?"], "sequential?",
135 ["`", "cons"], "cons",
136 ["`", "concat"], "concat",
137 ["`", "nth"], "_nth",
138 ["`", "first"], "_first",
139 ["`", "rest"], ["fn", ["a"], ["rest", "a"]],
140 ["`", "empty?"], "empty?",
141 ["`", "count"], "_count",
142 ["`", "apply"], "_apply",
143 ["`", "map"], "_map",
146 ["`", "with-meta"], "with_meta",
147 ["`", "meta"], "meta",
148 ["`", "atom"], "atom",
149 ["`", "atom?"], "atom?",
150 ["`", "deref"], ["fn", ["a"], ["get", "a", ["`", "val"]]],
151 ["`", "reset!"], "reset!",
152 ["`", "swap!"], "swap!"]],