1234567891011121314151617181920(*
Prior to OCaml 4.13.0, [load_file] was in the Topdirs module.
Beginning with OCaml 4.13.0, load_file is in the Toploop module.
In order to be able to compile with OCaml versions either
before or after, open both modules and let the compiler
find [load_file] where it is defined.
*)openTopdirs[@@ocaml.warning"-33"]openToploop[@@ocaml.warning"-33"]letloadfilename=letbuf=Buffer.create16inletppf=Format.formatter_of_bufferbufinmatchload_fileppffilenamewith|true->()|false->Format.pp_print_flushppf();failwith@@Format.asprintf"Failed to load file `%s': %s"filename(Buffer.contentsbuf);;