4
votes

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)?

1
Can you be more precise ? By load do you mean #use A.ml ? - hivert
Exactly. I edited the question. - choeger

1 Answers

3
votes

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).