Knowledge.Object
Knowledge Base Objects.
The knowledge base stores object properties. The object itself is an identifier, and could be seen as a pointer or a database key.
type 'a t = 'a obj
scoped scope
pass a fresh new object to scope
.
The extent of the created object is limited with the extent of the function scope
. The object passed to the scope
function is automatically deleted after the computation, returned by scope
evaluates to a value. The identity of an object could be reused, which may lead to hard detected bugs, thus care should be taken to prevent the object value from escaping the scope of the function.
null cls
is the null object of the class cls
.
For each class cls
there is null
that represents an absence of object. It is unique and is represented as zero.
Dereference of the null object (e.g., using collect
) always returns an empty denotation. Any information stored in the object is forgotten (discarded). Promises are never run on the null object, therefore the promise will never receive the null object as its input.
val is_null : _ obj -> bool
is_null obj
is true
iff obj
is the null object of its class.
repr x
returns a textual representation of the object x
cast class_equality x
changes the type of an object.
Provided with an equality of two object types, returns the same object x
with a new type.
The type equality of two object types could be obtained through Class.equal
or Class.assert_equal
. Note, this function doesn't do any magic, this is just the Type_equal.conv
, lifted into the Object
module for covenience.
val id : 'a obj -> Core_kernel.Int63.t
id obj
returns the internal representation of an object.
module type S = sig ... end
Ordered and persistent data types.