OCaml toplevel multiple dependencies

ocaml

Solution

You should compile all your modules with ocamlc to produce the files `a.cmo` and `b.cmo` and then run `ocaml b.cmo a.cmo` (the order is important because `B` must be loaded before `A`).

Problem

When I have multiple dependencies, say ``` module A = struct open B ... end module B = struct ... end ``` Is it possible to let the OCaml toplevel/utop load A.ml with all dependencies (i.e.`#use "./A.ml"` automatically loads B.ml)?

Original source