View · Search · Index
No registered users in community xowiki
in last 10 minutes

Re: [Xotcl] full trace support for XOTcl methods/procs

From: Kristoffer Lawson <>
Date: Tue, 1 Jan 2008 17:04:19 +0200

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.