Module Dynamic

module Dynamic: sig .. end
Dynamic plug-ins: registration and use.
Consult the Plugin Development Guide for additional details.

val default_path : unit -> string list

Registration


val register : ?comment:string ->
plugin:string -> string -> 'a Type.t -> journalize:bool -> 'a -> 'a
register ~plugin name ty v registers v with the name name, the type ty and the plug-in plugin.
Raises Type.AlreadyExists if name already exists. In other words you cannot register a value with the same name twice.
Change in Boron-20100401: add the labeled argument "plugin"
Change in Oxygen-20120901: add the optional labeled argument "comment"
Consult the Plugin Development Guide for additional details.

Access


exception Incompatible_type of string
exception Unbound_value of string
exception Unloadable of string
Exception that a plug-in can throw if it detects that it can't be loaded. It is caught by Dynamic.load_module and Dynamic.load_script
Since Oxygen-20120901
val get : plugin:string -> string -> 'a Type.t -> 'a
get ~plugin name ty returns the value registered with the name name, the type ty and the plug-in plugin. This plug-in will be loaded if required.
Raises Consult the Plugin Development Guide for additional details.
val iter : (string -> 'a Type.t -> 'a -> unit) -> unit
val iter_comment : (string -> string -> unit) -> unit
Since Oxygen-20120901
val is_plugin_present : string -> bool
Since Nitrogen-20111001
Returns true iff the given plug-in is loaded and usable.

Dedicated access to plug-in parameters


module Parameter: sig .. end
Module to use for accessing parameters of plug-ins.

Kernel materials


val object_file_extension : string
Object file extension used when loading a module. See function Dynamic.load_module.
Since Boron-20100401
val add_path : string -> bool
Add a path into the search paths, if it is not already in the list.
Returns true iff the path is really added to the list.
val load_module : string -> unit
Load the module with the given name. The module is searched in search paths if the name is implicit (that is if the file name is relative and does not start with an explicit reference to the current directory (./ or ../ in Unix). Do nothing if dynamic loading is not available.
Change in Nitrogen-20111001: better strategy for searching modules
val load_script : string -> unit
Compile then load the OCaml script with the given name. The file is searched in the current directory, next in search paths if the name is implicit (that is if the file name is relative and does not start with an explicit reference to the current directory (./ or ../ in Unix). Do nothing if dynamic loading is not available.
Since Beryllium-20090601-beta1
Change in Nitrogen-20111001: better strategy for searching modules
val set_default : bool -> unit
Search in all the default directories iff the parameter is true.
Since Boron-20100401
val add_dependencies : from:string -> string -> unit
add_dependencies ~from p indicates that the plugin from must be loaded before p.
Since Neon-20130301