Thomas A. Russ <tar@sevak.isi.edu> wrote:
+---------------
| "Steven E. Harris" <seh@panix.com> writes:
| > Julian Stecklina <der_julian@web.de> 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":
http://common-lisp.net/project/cmucl/doc/cmu-user/extensions.html#toc83
...
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
-----
Rob Warnock <rpw3@rpw3.org>
627 26th Avenue <URL:http://rpw3.org/>
San Mateo, CA 94403 (650)572-2607