package acgtk

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Environment.EnvironmentSource

Sourceexception Signature_not_found of string

This exception can be raised when a signature or an entry is not found in the environmnent

Sourceexception Lexicon_not_found of string
Sourceexception Entry_not_found of string

The modules implementing the signatures and the lexicons managed by the environment

Exceptions raised when interpretations of types or constants are duplicated

Sourcetype t

The type of the environment

Sourcetype entry =
  1. | Signature of Signature1.t
  2. | Lexicon of Lexicon.t

The type of what an environment can contain

Sourceval empty : t

empty is the empty environmnent

Sourceval insert : ?overwrite:bool -> entry -> to_be_dumped:bool -> t -> t

insert c d e adds the content c into the environment e and returns the resulting environmnent. If d is set to true, then c is dumped in e by the Environment.Environment_sig.write function. The default value for the overwrite optional parameter is false.

Sourceval get_signature : string -> t -> Signature1.t

get_signature name e returns the signature of name name in the environment e. Raise Environment.Environment_sig.Signature_not_found if such a signature does not exist

Sourceval get_lexicon : string -> t -> Lexicon.t

get_lexicon name e returns the signature of name name in the environment e. Raise Environment.Environment_sig.Lexicon_not_found if such a signature does not exist

Sourceval get : string -> t -> entry

get name e returns the entry of name name in the environment e. Raise Environment.Environment_sig.Lexicon_not_found if such an entry does not exist.

Sourceval append : ?overwrite:bool -> t -> t -> t

append e1 e2 merges the two environment e1 and e2. If an entry appears in both environment then the one of e2 is kept if the overwrite parameter is set to true (default is false). If set to false, if an entry appears in both environment, an error is emitted.

Sourceval iter : (entry -> unit) -> t -> unit

iter f e applies f to every data contained in the environment

Sourceval fold : (entry -> 'a -> 'a) -> 'a -> t -> 'a

fold f a e returns f a_n (f a_n-1 (... (f a1 (f a0 a)) ... )) where the a_0 ... a_n are the n+1 elements of the environmnent

Sourceval sig_number : t -> int

sig_number e returns the number of signatures an environment contains

Sourceval lex_number : t -> int

sig_number e returns the number of lexicons an environment contains

Sourceval choose_signature : t -> Signature1.t option

choose_signature e returns a randomly chosen signature in the environment e

Sourceval compatible_version : t -> bool

compatible_version e returns true if the environment e was created with the current versions of the compilers and/or interpreter

Sourceval read : string -> string list -> t option

read filename dirs returns Some e if the file filename contains the output value of an enviromnent compatible with the current version of the software. It returns None otherwise. The file filename is looked up in the list of directories dirs.

Sourceval write : string -> t -> unit

write filename e write the output value of the enviromnent e into the file filename

Sourceval select : string -> t -> t
Sourceval unselect : t -> t
Sourceval focus : t -> entry option