6.1.1 Using Different Synopsis

Did you notice that after defining a synopsis, there is actually never any explicit reference to it anymore? So where is the magick? In fact, there’s no magick at all involved here.

Clon has a global variable named *synopsis* which holds the current synopsis. When you define/create a synopsis with either defsynopsis or make-synopsis, it is automatically made the default one, unless you use the :make-default option/initarg with a value of nil, like this:

(defsynopsis (:make-default nil) ...)

or this:

(make-synopsis :make-default nil ...)

When you create a context with make-context, the default synopsis is used implicitely, but you have two ways to avoid this.

  1. At any time in your program, you may change the value of *synopsis*. All subsequent calls to make-context will hence use this other synopsis.
  2. If you prefer to use another synopsis only temporarily, you can use the :synopsis initarg to make-context instead.