aboutsummaryrefslogtreecommitdiff
path: root/miniMAL/printer.json
blob: 99f419814cef60ea750ec59c63e8c500bb34c489 (plain)
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
["do",

["def", "pr-str", ["fn", ["exp", "print_readably"],
  ["if", ["list?", "exp"],
    ["str",
      ["`", "("],
      [".", ["map", ["fn", ["x"], ["pr-str", "x", "print_readably"]], "exp"],
            ["`", "join"], ["`", " "]],
      ["`", ")"]],
  ["if", ["=", ["`", "string"], ["type", "exp"]],
    ["str", ["`", "\""], "exp", ["`", "\""]], 
  ["if", ["=", ["`", "number"], ["type", "exp"]],
    "exp", 
  ["if", ["=", null, "exp"],
    ["`", "nil"],
  ["if", ["=", true, "exp"],
    ["`", "true"],
  ["if", ["=", false, "exp"],
    ["`", "false"],
  ["if", ["symbol?", "exp"],
    ["get", "exp", ["`", "val"]],
  ["str", ["`", "#<unknown: "], "exp", ["`", ">"]]]]]]]]]]],

null
]