Calls the next piece of advice associated with a function.




call-next-advice args


args are arguments to be given to the next piece of advice to be called. Any number of arguments may be given in this way, including keyword arguments, and there is no requirement for pieces of around advice to receive the same number of arguments as the original definition expected.


call-next-advice returns the values produced by the call to the next piece of advice (or to the combination of before and after advice and the original definition).


call-next-advice is the local function used to invoke the next item in the ordering of pieces of advice associated with a function. It can only be called from within the scope of the around advice. Advice may be attached to a function by defadvice and this allows the behavior of a function to be modified. Extra code to be performed before or after the function may be simply added by creating before or after advice for it. Around advice is more powerful and replaces the original definition. All the advice for a function is ordered with the around advice coming first.

The first piece of around advice receives the arguments to the function and may return any values at all. It has access to the rest of the advice, and to the original definition, by means of call-next-advice . A call to this from within the body of the around advice invokes the next piece of around advice with the arguments given to call-next-advice . The last piece of around advice in the ordering invokes the sequence of before advice, the original definition, and after advice if it calls call-next-advice . Around advice may contain any number of calls to call-next-advice , including no calls.


call-next-advice is an extension to Common Lisp. See the LispWorks User Guide for a broader discussion of advice .

See also


LispWorks Reference Manual - 12 Mar 2008