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 JM |
30 | ["get", "exp", ["`", "val"]], |
31 | ["str", ["`", "#<unknown: "], "exp", ["`", ">"]]]]]]]]]]], | |
32 | ||
c5d30235 JM |
33 | ["def", "pr-list", ["fn", ["lst", "print_readably", "sep"], |
34 | [".", ["map", ["fn", ["s"], ["pr-str", "s", "print_readably"]], "lst"], | |
35 | ["`", "join"], "sep"]]], | |
36 | ||
c1fe72ae JM |
37 | null |
38 | ] |