ocaml / oloop

Evaluate code through the OCaml toploop for inclusion in educational material.
ISC License
12 stars 5 forks source link

invalid directives don't give any error #29

Open agarwal opened 9 years ago

agarwal commented 9 years ago

The outcome is empty when giving an invalid directive, e.g.

# Oloop.with_toploop Oloop.Outcome.merged
  ~f:(fun t -> Oloop.eval t "#asdf;;" >>| fun x -> Ok x)
  >>| ok_exn
  >>| function
      | `Uneval _ -> assert false
      | `Eval e -> Oloop.Outcome.(result e, stdout e, warnings e)
;;
- : Outcometree.out_phrase * string * (Location.t * Warnings.t) list = (Outcometree.Ophr_signature [], "", [])

OCaml's toplevel gives:

# #asdf;;
Unknown directive `asdf'.