[Xotcl] full trace support for XOTcl methods/procs
Kristoffer Lawson
setok at fishpool.com
Tue Jan 1 16:04:19 CET 2008
On 1 Jan 2008, at 14:33, Eckhard Lehmann wrote:
> Especially I look for a way to execute a proc before *every*
> statement inside an instproc. [trace] can do this via the
> "enterstep" and "leavestep" operators to [trace add execution]. Is
> this possible with filters and filterguards?
As you say, [trace] can do that. For XOTcl methods it is possible
with filters as they are executed before the actual method, which
only gets run when [next] is called. So with filters you can handle
both the enter and the leave. Using filters you could easily build a
framework that would allow you to specify which methods to catch.
I've done this with my Memorisation class (for caching). I can
specify which methods I want to cache and the filter deals with that.
It was created before filterguards so it may be even easier (and
faster) to do with today's filters.
/ http://www.scred.com/
/ http://www.fishpool.com/~setok/
More information about the Xotcl
mailing list