Okay, so I almost think I have a solution to this.<br><br>Can I have something like "trace", where instead of printing the argument line, it passes it to a function?<br><br>Like a function uber-trace<br><br>where:<br>
<br>(trace foo) = (uber-trace foo (lambda (args) (pp args)))<br><br><br><br><div class="gmail_quote">On Fri, Feb 20, 2009 at 8:04 PM, lowly coder <span dir="ltr"><<a href="mailto:lowlycoder@huoyanjinjing.com">lowlycoder@huoyanjinjing.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Code:<br><br>~/code/irc$ cat trace.scm<br>(define (foo x) x)<br><br>(define (bar) (foo 0))<br>
<br>(define (test)<br>  (foo 1)<br>  (bar))<br>  <br>(trace foo)<br><br>(test)<br>~/code/irc$ gsi trace.scm<br>| > (foo 1)<br>
| 1<br>| > (foo 0)<br>| 0<br><br><br>Problem:<br><br>Can I control trace where I can say "trace foo, but not when it's called by bar".<br><br>I.e. rather than just saying "trace this function", I would like to be able to say:<br>

<br><br>(trace foo predicate)<br><br>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<br><br><br>

<br>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)<br>
</blockquote></div><br>