module Global: Extlib.GlobalMutable global variable.
Often in OCaml you want to have a global variable, which is mutable
and uninitialized when declared. You can use a 'a option ref but
this is not very convenient. The Global module provides functions
to easily create and manipulate such variables.
Author(s): Nicolas Cannasse, David Teller (boilerplate code)
type 'a t
exception Global_not_initialized of string
val empty : string -> 'a tval name : 'a t -> stringval set : 'a t -> 'a -> unitval get : 'a t -> 'aval undef : 'a t -> unitval isdef : 'a t -> booltrue if the global value has been set.val opt : 'a t -> 'a optionNone if the global is undefined, else Some v where v is the
current global value contents.val t_of_sexp : (Sexplib.Sexp.t -> 'a) -> Sexplib.Sexp.t -> 'a tval sexp_of_t : ('a -> Sexplib.Sexp.t) -> 'a t -> Sexplib.Sexp.t