Next: Queues, Previous: Docstrings, Up: The language [Contents][Index]
Datums are the mechanism by which Librep allows Lisp programs to define new data types, such that these types are completely distinct from the built-in data types (i.e. they match none of the standard type predicates).
They also provide encapsulation, in that the data objects they provide are completely opaque, unless a pre-defined value is known (which was specified when the object was created, and is typically known only by the object’s creator).
These functions are provided in rep.data.datums.
Create and return a new datum object. It has the value value associated with it, and has type key.
If arg has type key, then return the value associated with it. Otherwise, an error is signalled.
If arg has type key, then set the value associated with it to be value. Otherwise, an error is signalled.
Return true if arg has type key.
Associate the function printer with all datum objects of type key. When any such object is printed, printer is applied to two arguments, the datum and the stream to which it should be printed (see Output Streams).