package b0

  1. Overview
  2. Docs
Software construction and deployment kit

Install

dune-project
 Dependency

Authors

Maintainers

Sources

b0-0.0.5.tbz
sha512=00a6868b4dfa34565d0141b335622a81a0e8d5b9e3c6dfad025dabfa3df2db2a1302b492953bbbce30c3a4406c324fcec25250a00b38f6d18a69e15605e3b07e

doc/b0/B0_def/index.html

Module B0_defSource

B0 definitions.

B0 definitions are uniquely named OCaml values of different types used for describing software construction. The value names are used for end-user interaction.

B0 definitions occur in various B0 files and libraries during the module initialisation phase of the program consuming the definitions. After the module initialisation phase no new definition is allowed.

This module handle the management of these named values in B0 files and libraries. It provides the infrastructure to track the location of their definition, properly scope the names, check their unicity in the scope, index them and make sure they cannot be defined after the module initialisation phase of the program.

Definitions

Sourcemodule Scope : sig ... end

Scopes are used to track and scope B0 definitions created by libraries and B0 files.

Sourcetype t

The type for definition names and their scoping information.

Sourcetype def = t

See t.

Sourceval scope : t -> Scope.t

scope d is the scope in which d is defined.

Sourceval file : t -> B0_std.Fpath.t option

file d is the absolute file path in which d is defined, if defined in a file.

Sourceval scope_dir : t -> B0_std.Fpath.t option

scope_dir is the parent of file d.

Sourceval name : t -> string

name d is the qualified name of d.

Sourceval doc : t -> string

doc d is a one-line documentation string for d.

Sourceval meta : t -> B0_meta.t

meta is the metadata associated to the definition.

Sourceexception Err of string

Exception thrown if a definition error occurs. This can be due to

  • Duplicate name.
  • Malformed name.

The argument is an error message to print as is. The backtrace should point to the redefinition (it is unfortunately difficult to keep track of the previous definition).

Defining values

Sourcemodule type VALUE = sig ... end

The type for values to be named.

Sourcemodule type S = sig ... end

The type of named values.

Sourcemodule Make (V : VALUE) : S with type t = V.t

Make (V) names the values of V.