diff --git a/src/lib/uTop.ml b/src/lib/uTop.ml index f10831d..f7e9b46 100644 --- a/src/lib/uTop.ml +++ b/src/lib/uTop.ml @@ -811,6 +811,18 @@ let () = (* Make UTop accessible. *) Topdirs.dir_directory (Findlib.package_directory "utop") + (* +-----------------------------------------------------------------+ + | Compiler-libs re-exports | + +-----------------------------------------------------------------+ *) + +#if OCAML_VERSION >= (4, 08, 0) +let get_load_path ()= Load_path.get_paths () +let set_load_path path= Load_path.init path +#else +let get_load_path ()= !Config.load_path +let set_load_path path= Config.load_path := path +#endif + (* +-----------------------------------------------------------------+ | Deprecated | +-----------------------------------------------------------------+ *) diff --git a/src/lib/uTop.mli b/src/lib/uTop.mli index 86c1119..93ca7fe 100644 --- a/src/lib/uTop.mli +++ b/src/lib/uTop.mli @@ -356,6 +356,15 @@ val discard_formatters : Format.formatter list -> (unit -> 'a) -> 'a val split_words : string -> string list + (** {6 compiler-libs reexports} *) + +val get_load_path : unit -> string list +val set_load_path : string list -> unit + (** [get_load_path] is an alias of [Config.load_path], normally hidden in toplevel. + [get_load_path] and [set_load_path] manage the include directories. + + The internal variable contains the list of directories added by findlib-required packages + and [#directory] directives. *) (**/**) (* These variables are not used and deprecated: *)