Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
The Ephemeron module is not loaded into the toplevel #7555
Original bug ID: 7555
The Ephemeron module neither can be used in the toplevel nor be loaded into it. Since Ephemeron is a part of the stdlib.cma archive I would assume, that it should work without any action from a user, especially, since no cma or cmo file is shipped with the compiler, that will allow us to enable the Ephemeron module explicitly in the toplevel with the load directive.
Steps to reproduce
val create : unit -> ('k, 'd) Ephemeron.K1.t
Error: Reference to undefined global `Ephemeron'
(* OCaml 4.04.0 manifests the same behavior *)
A workaround is to load the stdlib.cma archive explicitly, either with the load directive or by passing it as an object to the toplevel, e.g.,
I've tried to figure out how top-level loads the code, and apparently it automatically loads all modules, that are imported, and since Ephemeron is not used in any of the toplevel libraries it is not loaded. A possible workaround would be to add a bogus module E = Ephemeron to the toploop.ml, but this sound awkwardly wrong.