Page 342 Table of Contents Index Page 344
Chapters
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30
A, B, C, D, E





Appendix B

The CLIM-SYS Package

The clim-sys package where useful "system-like" functionality lives, including such things as
resources and multi-processing primitives. It contains concepts that are not part of Common
Lisp, but which are not conceptually the province of CLIM itself.

All of the symbols documented in this appendix must be accessible as external symbols in the
clim-sys package.

B.1 Resources

CLIM provides a facility called resources that provides for reusing objects. A resource describes
how to construct an object, how to initialize and deinitialize it, and how an object should be
selected from the resource of objects based on a set of parameters.

=> defresource name parameters &key constructor initializer deinitializer matcher initial-copies
[Macro]
Defines a resource named name, which must be a symbol. parameters is a lambda-list giving
names and default values (for optional and keyword parameters) of parameters to an object of
this type.

constructor is a form that is responsible for creating an object, and is called when someone tries
to allocate an object from the resource and no suitable free objects exist. The constructor form
can access the parameters as variables. This argument is required.

initializer is a form that is used to initialize an object gotten from the resource. It can access
the parameters as variables, and also has access to a variable called name, which is the object to
be initialized. The initializer is called both on newly created objects and objects that are being
reused.


Page 342 Table of Contents Index Page 344
Chapters
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30
A, B, C, D, E