module BatGlobal:sig..end
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_exn : 'a t -> 'aval get : 'a t -> 'a optionNone if the global is undefined, else Some v where v is
the current global value contents.val undef : 'a t -> unitval isdef : 'a t -> booltrue if the global value has been set.