Some definition forms are macros that expand into a group of other definitions, for example
defstruct
. When the form is associated with a dspec class, the subdefinitions can be automatically recorded as being subforms of the new definition, by use of the def macro.
This means that the dspec system knows that the subdefinitions were inside the main definition (indeed, inside this particular form). Therefore
Note: to make source location work you will also need a define-form-parser definition for the macro that expands into the def.
Note: def defines a relation between two particular definitions, for example
(defstruct foo)
and
(defun make-foo)
, not between the two dspec classes.