diff options
| author | Chouser <chouser@n01se.net> | 2015-01-30 12:38:44 -0500 |
|---|---|---|
| committer | Chouser <chouser@n01se.net> | 2015-01-30 12:54:43 -0500 |
| commit | 1ac37587be54c9b3d51d042796f303d9f8e03594 (patch) | |
| tree | 0c0bd0e5fda8cf3897b85f5a7a8f20c9b5320988 | |
| parent | f5fc0c98ee9c140077469146bbc9d8a77fdb02f3 (diff) | |
| download | mal-1ac37587be54c9b3d51d042796f303d9f8e03594.tar.gz mal-1ac37587be54c9b3d51d042796f303d9f8e03594.zip | |
OCaml: Fix stepA command-line script running
| -rw-r--r-- | ocaml/stepA_interop.ml | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/ocaml/stepA_interop.ml b/ocaml/stepA_interop.ml index e159de4..1aab28a 100644 --- a/ocaml/stepA_interop.ml +++ b/ocaml/stepA_interop.ml @@ -140,19 +140,20 @@ let rec main = if Array.length Sys.argv > 1 then ignore (rep ("(load-file \"" ^ Sys.argv.(1) ^ "\")") repl_env) - else - ignore (rep "(println (str \"Mal [\" *host-language* \"]\"))" repl_env); - while true do - print_string "user> "; - let line = read_line () in - try - print_endline (rep line repl_env); - with End_of_file -> () - | Invalid_argument x -> - output_string stderr ("Invalid_argument exception: " ^ x ^ "\n"); - flush stderr - | _ -> - output_string stderr ("Erroringness!\n"); - flush stderr - done + else begin + ignore (rep "(println (str \"Mal [\" *host-language* \"]\"))" repl_env); + while true do + print_string "user> "; + let line = read_line () in + try + print_endline (rep line repl_env); + with End_of_file -> () + | Invalid_argument x -> + output_string stderr ("Invalid_argument exception: " ^ x ^ "\n"); + flush stderr + | _ -> + output_string stderr ("Erroringness!\n"); + flush stderr + done + end with End_of_file -> () |
