Hi,
Sorry this seems like a ridiculous question to have to ask but how does one go about loading a module so that it is still contained in it’s own “namespace” (not sure this is the correct term, “submodule”?) when using a REPL such as utop?
Everywhere I look I am seeing the suggestion to do: #use "MyModlue.ml";;
Which almost does what I am asking but puts everything into the Toplevel and not into its own module. I can make it work using this command by wrapping the file contents in something like:
MyModule.ml
module MyModlue = struct
(* File contents: E.g. *)
let give_me_some_string = "Hello World"
end
But then it’s unreadable from another file in the project with something like:
Main.ml
let () = print_endline MyModlue.give_me_some_string