Thomas A. Russ <email@example.com> wrote:
| "Steven E. Harris" <firstname.lastname@example.org> writes:
| > Julian Stecklina <email@example.com> writes:
| > > You could automatically instrument all functions in, say, a given
| > > package or by name to call PROCESS-YIELD, if they are called or
| > > return.
| > Aside from shadowing DEFUN as you had suggested, is there another
| > mechanism by which one can do this instrumenting?
| Some lisp systems support the non-standard ADVISE functionality, which
| lets you wrap code around existing functions. But I don't think CMUCL
| is one of the lisps that support this.
CMUCL has "Function Wrappers":
Function wrappers, fwrappers for short, are a facility for
efficiently encapsulating functions.
A function wrapper replaces the primary function in the fdefn
object with a function of its own, and records the original
function in an fwrapper object, a funcallable instance. Thus,
when the function is called, the fwrapper gets called, which in
turn might call the primary function, or a previously installed
fwrapper that was found in the fdefn object when the second
fwrapper was installed.
Not sure it can do what you want, but there it is... ;-}
Rob Warnock <firstname.lastname@example.org>
627 26th Avenue <URL:http://rpw3.org/>
San Mateo, CA 94403 (650)572-2607