At the beginning of Js_of_ocaml form.ml file, there is
What does that mean ? (as there are no import.ml file, but js_of_ocaml__Import.cmi, .cmt and .cmx, I imagine it imports modules from those files, but I would like to understand)
The import file is here: https://github.com/ocsigen/js_of_ocaml/blob/master/lib/js_of_ocaml/import.ml. FWIW, I think the
open! Import you’re referencing is here.
Just in case you’re also asking about the
open M brings all of the items in the module
M into scope. The compiler will warn you if this open statement is unneeded, that is if you don’t use any of the items in
M. However, using
open! M instead will prevent this warning.
Hmm, a small correction is needed here,
open M warns if any of the items from
M shadow any items that are already in scope. E.g.,
module M = struct let test = "" end
let test = ""
let () = print_endline test
Warning number 44
OCaml preview 5:1-6
this open statement shadows the value identifier test (which is later used)
Ah shoot, that too — thanks!