[gambit-list] limiting trace

lowly coder lowlycoder at huoyanjinjing.com
Fri Feb 20 23:04:14 EST 2009


Code:

~/code/irc$ cat trace.scm
(define (foo x) x)

(define (bar) (foo 0))

(define (test)
  (foo 1)
  (bar))

(trace foo)

(test)
~/code/irc$ gsi trace.scm
| > (foo 1)
| 1
| > (foo 0)
| 0


Problem:

Can I control trace where I can say "trace foo, but not when it's called by
bar".

I.e. rather than just saying "trace this function", I would like to be able
to say:


(trace foo predicate)

where predicate is a function that takes as input the "stack" frame, and as
output creates a #t / #f, which decides whether this particular trace should
be printed



On a side note -- all the cool debugging functions in Gambit -- is this part
of the 100K LOC scheme or 50K LOC hand written C? (hoping it's the former)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.iro.umontreal.ca/pipermail/gambit-list/attachments/20090220/1b143878/attachment.htm>


More information about the Gambit-list mailing list