miniMAL: step1.
[jackhill/mal.git] / miniMAL / printer.json
CommitLineData
c1fe72ae
JM
1["do",
2
3["def", "pr-str", ["fn", ["exp", "print_readably"],
4 ["if", ["list?", "exp"],
5 ["str",
6 ["`", "("],
7 [".", ["map", ["fn", ["x"], ["pr-str", "x", "print_readably"]], "exp"],
8 ["`", "join"], ["`", " "]],
9 ["`", ")"]],
10 ["if", ["=", ["`", "string"], ["type", "exp"]],
11 ["str", ["`", "\""], "exp", ["`", "\""]],
12 ["if", ["=", ["`", "number"], ["type", "exp"]],
13 "exp",
14 ["if", ["=", null, "exp"],
15 ["`", "nil"],
16 ["if", ["=", true, "exp"],
17 ["`", "true"],
18 ["if", ["=", false, "exp"],
19 ["`", "false"],
20 ["if", ["=", ["`", "Symbol"], ["get", "exp", ["`", "type"]]],
21 ["get", "exp", ["`", "val"]],
22 ["str", ["`", "#<unknown: "], "exp", ["`", ">"]]]]]]]]]]],
23
24null
25]