4.1.3.3 Group Definition

There is one last point we need to address in order to complete this section. There might be times when you need to manipulate an explicit group object, but the object itself can still be created in a declarative (or mixed) way because you don’t need to keep references on its items. For this, Clon provides a macro called defgroup.

Macro: defgroup (OPTIONS…) ITEMS…

Define a new group and return it. This macro behaves exactly like the group form in a call to defsynopsis (see Groups). In fact, an intermediate step in the expansion of the defsynopsis macro is to transform group forms into defgroup macro calls. As for defsynopsis, defgroup allows you to mix declarative forms, constructor calls or any kind of Lisp code.