defadvice

Macro

Package: excl

Arguments: fspec where &rest forms

Starting in Allegro CL release 6.0, the new fwrapper facility, described in fwrappers-and-advice.htm, replaces the advice facility, and continued use of the advice facility is deprecated.

This macro allows advice to be defined in a format similar to a function definition (with defun).

fspec must name a function. It is typically a symbol but can be any function name, as in advise. fspec is not evaluated.

where is either a symbol or a list. If it is a symbol, it can either be the name of the advice or the class. If where is one of :before, :around, or :after, it is interpreted as the class. Any other symbol is interpreted as a name. When where is a symbol, the position of the advice defaults to nil. When where defines the name, the class of the advice defaults to :after. When where is the class, the name of the advice defaults to nil.

If where is a list, the first element (if there is one) is interpreted as the name, the second element as the class, and the third element, if there is one, as the position. If there is no second element, or the second element is nil, the class will be :after. Please refer to the definition of advise for information on the interpretation and behavior of the class, name and position of advice.

forms are Lisp forms which will be evaluated as if in a progn. Warning: forms cannot be the single form nil. If you want the single form nil (in, for example, :around advice to not call the function and return nil), specify (progn nil) instead.

See also fwrappers-and-advice.htm for general information on the new fwrapper facility and the older, now deprecated, advice facility in Allegro CL.

The documentation is described in introduction.htm and the index is in index.htm.

Copyright (c) 1998-2000, Franz Inc. Berkeley, CA., USA. All rights reserved.

Created 2000.10.5.