aboutsummaryrefslogtreecommitdiff
path: root/ocaml/step0_repl.ml
blob: e3478f726b0768c0611f49bb08e0044bc2fa6cf6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
(*
  To try things at the ocaml repl:
  rlwrap ocaml

  To see type signatures of all functions:
  ocamlc -i step0_repl.ml

  To run the program:
  ocaml step0_repl.ml
*)

let read str = str
let eval ast any = ast
let print exp = exp
let rep str = print (eval (read str) "")

let rec main =
  try
    while true do
      print_string "user> ";
      print_endline (rep (read_line ()));
    done
  with End_of_file -> ()