If I opam install oloop and try to use it from utop, it works fine:
$ utop
utop # #require "oloop";;
utop # open Core.Std;;
utop # open Async.Std;;
utop # let f() = Oloop.(with_toploop Output.merged ~f:(fun t -> eval t "2+3" >>| fun _ -> Ok ()));;
val f : unit -> unit Async_kernel.Std.Deferred.Or_error.t = <fun>
However, launching utop from within my working directory, I get a fatal error. Note, this ends up using the .ocamlinit file checked into the repo.
$ utop
utop # let f() = Oloop.(with_toploop Output.merged ~f:(fun t -> eval t "2+3" >>| fun _ -> Ok ()));;
>> Fatal error: f unbound at toplevel
Fatal error: exception Misc.Fatal_error
Raised at file "map.ml", line 117, characters 16-25
This has nothing to do with oloop. This is because you load compiler-libs.toplevel but they are already included in the toplevel — thus the conflict. It does not matter the binding you make.
If I
opam install oloop
and try to use it from utop, it works fine:However, launching utop from within my working directory, I get a fatal error. Note, this ends up using the .ocamlinit file checked into the repo.