The chameleon Reference Manual

This is the chameleon Reference Manual, version 1.0.1, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 08 16:37:59 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

The main system appears first, followed by any subsystem dependency.


2.1 chameleon

Configuration management facilities for Common Lisp with multiple profile support.

Author

YUE Daian

License

MIT

Version

1.0.1

Dependency

alexandria (system).

Source

chameleon.asd.

Child Component

src (module).


3 Modules

Modules are listed depth-first from the system components tree.


3.1 chameleon/src

Source

chameleon.asd.

Parent Component

chameleon (system).

Child Component

chameleon.lisp (file).


4 Files

Files are sorted by type and then listed depth-first from the systems components trees.


4.1 Lisp


4.1.1 chameleon/chameleon.asd

Source

chameleon.asd.

Parent Component

chameleon (system).

ASDF Systems

chameleon.


4.1.2 chameleon/src/chameleon.lisp

Source

chameleon.asd.

Parent Component

src (module).

Packages

chameleon.

Public Interface
Internals

5 Packages

Packages are listed by definition order.


5.1 chameleon

Source

chameleon.lisp.

Use List

common-lisp.

Public Interface
Internals

6 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


6.1 Public Interface


6.1.1 Macros

Macro: defconfig (&body configs)

Defines a configuration. The body CONFIGS contains multiple items, with each following this pattern:
(name initial-value &optional docstring)

While calling this macro, all the given names, initial-values and docstrings are evaluated during macro expansion.

Beneath the surface, DEFCONFIG actually generates the following stuff:

1. A variable *PROFILE*. It stores the current profile which is desired to be a keyword.

2. A variable *CONFIG*. It stores the current configuration instance.

3. A class named CONFIG. Each item maps to a slot definition:
- name maps to slot name.
- initial-value maps to :initform argument.
- docstring maps to :documentation property of the slot.

4. A zero-arity inline function (and its setf version) for each name. The function returns configuration value of current profile. When the value itself is a function, it is called every time and the value is returned. Otherwise, the value is directly returned.

5. Some other helper functions and macros:
- with-profile

A typical example is:
(defconfig
(server-port 5001 "The server port.")
(app-dir "/tmp"))

Package

chameleon.

Source

chameleon.lisp.

Macro: defprofile (name &body configs)

Defines a profile with given NAME. CONFIGS is one or more lists, with each following this pattern: (name value).

The evaluation rule of value follows DEFCONFIG.

It generates a variable *CONFIG-<NAME>* and a method SWITCH-PROFILE.

You may provide :before, :around or :after methods to SWITCH-PROFILE to insert some code.

Package

chameleon.

Source

chameleon.lisp.

Macro: eval-once (&body body)

Defines a closure to evaluate BODY for only once.

Package

chameleon.

Source

chameleon.lisp.


6.2 Internals


6.2.1 Ordinary functions

Function: config-item-to-slot (item)

Convert given ITEM to CLOS slot. ITEM should be the a 2 or 3 length pair in config definition.

Package

chameleon.

Source

chameleon.lisp.

Function: eval-config-var (profile package)
Package

chameleon.

Source

chameleon.lisp.

Function: make-config-var-name (name)
Package

chameleon.

Source

chameleon.lisp.

Function: make-keyword (thing)

Make a keyword out of given string THING. The keyword is guaranteed to be upper case.

Package

chameleon.

Source

chameleon.lisp.


6.2.2 Conditions

Condition: null-profile-error
Package

chameleon.

Source

chameleon.lisp.

Direct superclasses

error.


Appendix A Indexes


A.1 Concepts


A.3 Variables