toy scheme interpreter written in ocaml
def's return empty values, fix bug for multiple arguments to functions
0
0
0
let string_of_number n = match n with
|F f -> string_of_float f
|I i -> string_of_int i
(BranchD (sym, List.rev args), rest)
(BranchD (sym, args), rest)
|[] -> if List.length stack > 0 then List.hd stack else I 0
|[] -> if List.length stack > 0 then string_of_number (List.hd stack) else ""
match run code with
|F f -> string_of_float f
|I i -> string_of_int i
run code