Overview Clamps Packages CM Dictionary Clamps Dictionary Fomus
Next: A short example , Previous: Misc Packages , Up: Misc Packages , Home: General

Clamps Packages

cl-refs

cl-refs is a package dealing with the state (= value) of variables of an application and their synchronization.

In Common Lisp, assigning a value to a symbol is called binding. The most common ways to bind a value to a symbol are using the special forms let, setq, setf, defvar, defparameter or defconstant. During the course of running an application, the value bound to a symbol may change frequently as a consequence of user interaction or programmatic behaviour in certain situations, like reacting to external events, etc.1

Tracking those changes can be a challenging task, especially if the complexity of a program increases and values of different symbols need to be related to each other in a way that any change in one of these value should be reflected by the change of all other related values.

cl-refs addresses this task using a special class called ref-object with customized access functions and additional functions defining relations and actions to be executed on value change. See the next sections for examples and implementation details.

Footnotes:

1

With the notable exception of a value bound by defconstant, as a constant is an immutable value, which never changes.