Commit | Line | Data |
---|---|---|
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"]], | |
c5d30235 JM |
11 | ["if", "print_readably", |
12 | ["str", ["`", "\""], | |
13 | [".", | |
14 | [".", | |
15 | [".", "exp", | |
16 | ["`", "replace"], ["RegExp", ["`", "\\\\"], ["`", "g"]], ["`", "\\\\"]], | |
17 | ["`", "replace"], ["RegExp", ["`", "\""], ["`", "g"]], ["`", "\\\""]], | |
18 | ["`", "replace"], ["RegExp", ["`", "\n"], ["`", "g"]], ["`", "\\n"]], | |
19 | ["`", "\""]], | |
20 | "exp"], | |
c1fe72ae | 21 | ["if", ["=", ["`", "number"], ["type", "exp"]], |
c5d30235 | 22 | "exp", |
c1fe72ae JM |
23 | ["if", ["=", null, "exp"], |
24 | ["`", "nil"], | |
25 | ["if", ["=", true, "exp"], | |
26 | ["`", "true"], | |
27 | ["if", ["=", false, "exp"], | |
28 | ["`", "false"], | |
5351b94a | 29 | ["if", ["symbol?", "exp"], |
c1fe72ae | 30 | ["get", "exp", ["`", "val"]], |
dc2c5b3d JM |
31 | ["if", ["malfunc?", "exp"], |
32 | ["str", ["`", "(fn* "], | |
33 | ["pr-str", ["get", "exp", ["`", "params"]]], | |
34 | ["`", " "], | |
35 | ["pr-str", ["get", "exp", ["`", "ast"]]], | |
36 | ["`", ")"]], | |
37 | ["str", ["`", "#<unknown: "], "exp", ["`", ">"]]]]]]]]]]]], | |
c1fe72ae | 38 | |
c5d30235 JM |
39 | ["def", "pr-list", ["fn", ["lst", "print_readably", "sep"], |
40 | [".", ["map", ["fn", ["s"], ["pr-str", "s", "print_readably"]], "lst"], | |
41 | ["`", "join"], "sep"]]], | |
42 | ||
c1fe72ae JM |
43 | null |
44 | ] |