A specification list is required for an Edebug specification if
some arguments of a macro call are evaluated while others are not. Some
elements in a specification list match one or more arguments, but others
modify the processing of all following elements. The latter, called
specification keywords, are symbols beginning with `&' (such
as &optional
).
A specification list may contain sublists which match arguments that are themselves lists, or it may contain vectors used for grouping. Sublists and groups thus subdivide the specification list into a hierarchy of levels. Specification keywords apply only to the remainder of the sublist or group they are contained in.
When a specification list involves alternatives or repetition, matching it against an actual macro call may require backtracking. See section Backtracking in Specifications, for more details.
Edebug specifications provide the power of regular expression matching, plus some context-free grammar constructs: the matching of sublists with balanced parentheses, recursive processing of forms, and recursion via indirect specifications.
Here's a table of the possible elements of a specification list, with their meanings:
sexp
form
place
setf
construct.
body
&rest form
. See &rest
below.
function-form
quote
rather than
function
, since it instruments the body of the lambda expression
either way.
lambda-expr
&optional
[&optional specs...]
. To specify that several
elements must all match or none, use &optional
[specs...]
. See the defun
example below.
&rest
[&rest specs...]
.
To specify several elements that must all match on every repetition, use
&rest [specs...]
.
&or
&or
specification fails.
Each list element following &or
is a single alternative. To
group two or more list elements as a single alternative, enclose them in
[...]
.
¬
&or
, but if any of them match, the specification fails. If none
of them match, nothing is matched, but the ¬
specification
succeeds.
&define
&define
keyword should be the first element in
a list specification.
nil
gate
let
example
below.
other-symbol
def-edebug-spec
just as for macros. See the defun
example below.
Otherwise, the symbol should be a predicate. The predicate is called
with the argument and the specification fails if the predicate returns
nil
. In either case, that argument is not instrumented.
Some suitable predicates include symbolp
, integerp
,
stringp
, vectorp
, and atom
.
[elements...]
"string"
'symbol
, where the name
of symbol is the string, but the string form is preferred.
(vector elements...)
(elements...)
(spec . [(more
specs...)])
) whose elements match the non-dotted list arguments.
This is useful in recursive specifications such as in the backquote
example below. Also see the description of a nil
specification
above for terminating such recursion.
Note that a sublist specification written as (specs . nil)
is equivalent to (specs)
, and (specs .
(sublist-elements...))
is equivalent to (specs
sublist-elements...)
.
Here is a list of additional specifications that may appear only after
&define
. See the defun
example below.
name
:name
:name
should be a symbol; it is used as an additional
name component for the definition. You can use this to add a unique,
static component to the name of the definition. It may be used more
than once.
arg
lambda-list
def-body
body
, described above, but a definition body must be instrumented
with a different Edebug call that looks up information associated with
the definition. Use def-body
for the highest level list of forms
within the definition.
def-form
def-body
, except use this to match a single form rather than
a list of forms. As a special case, def-form
also means that
tracing information is not output when the form is executed. See the
interactive
example below.
Go to the first, previous, next, last section, table of contents.