Merge branch 'wasamasa-elisp'
[jackhill/mal.git] / ocaml / step0_repl.ml
1 (*
2 To try things at the ocaml repl:
3 rlwrap ocaml
4
5 To see type signatures of all functions:
6 ocamlc -i step0_repl.ml
7
8 To run the program:
9 ocaml step0_repl.ml
10 *)
11
12 let read str = str
13 let eval ast any = ast
14 let print exp = exp
15 let rep str = print (eval (read str) "")
16
17 let rec main =
18 try
19 while true do
20 print_string "user> ";
21 print_endline (rep (read_line ()));
22 done
23 with End_of_file -> ()