Hi Grant - <br><br>I think it's not too hard to implement it - I am still a macro newbie, but I think below is what you want... <br><br>(module trace-helper mzscheme <br> (require (lib "trace.ss")) <br> (define-syntax trace-lambda
<br> (syntax-rules () <br> ((_ name (var ...) exp exp2 ...)<br> (begin <br> (letrec ((name (lambda (var ...) exp exp2 ...)))<br> (trace name)<br> name)))))<br> (define-syntax trace-let
<br> (syntax-rules () <br> ((_ name ((var val) ...) exp exp2 ...)<br> ((letrec ((name <br> (trace-lambda name (var ...)<br> exp exp2 ...)))<br> name)<br>
val ...))))<br> (provide (all-from (lib "trace.ss"))) <br> (provide (all-defined)))<br><br>(require trace-helper) <br><br>; example from chez <br>(define half<br> (trace-lambda half (x)<br> (cond<br>
[(zero? x) 0]<br> [(odd? x) (half (- x 1))]<br> [(even? x) (+ (half (- x 1)) 1)])))<br>(half 5)<br>(define half<br> (trace-lambda half (x)<br> (cond<br> [(zero? x) 0]<br> [(odd? x) (half (trace-let decr-value () (- x 1)))]
<br> [(even? x) (+ (half (- x 1)) 1)])))<br>(half 5)<br><br><br><br><div><span class="gmail_quote">On 4/26/07, <b class="gmail_sendername">Grant Rettke</b> <<a href="mailto:grettke@acm.org">grettke@acm.org</a>> wrote:
</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Yea don't get me wrong is a great tool.<br><br>For some folks traced functions are nice for graphically illustrating
<br>"what happens", and help them better visualize things.<br><br>On 4/26/07, jos koot <<a href="mailto:jos.koot@telefonica.net">jos.koot@telefonica.net</a>> wrote:<br>><br>><br>> May be the Debug button of Drscheme can be useful for you. It allows
<br>> stepwise evaluation, breakpoints to be set and cleared and so on. This<br>> functionality is available without corrupting your source code with tracing<br>> command. All functions speek for themselves; you dont need a manual to use
<br>> it. In my opinion it's a fine tool.<br>> Jos Koot<br>><br>> (((((lambda(x)((((((((x x)x)x)x)x)x)x)x))<br>> (lambda(x)(lambda(y)(x(x y)))))<br>> (lambda(x)(x)x))<br>> (lambda()(printf "Greetings, Jos~n"))))
<br>><br>> ----- Original Message -----<br>> From: Grant Rettke<br>> To: <a href="mailto:plt-scheme@list.cs.brown.edu">plt-scheme@list.cs.brown.edu</a><br>> Sent: Thursday, April 26, 2007 10:50 PM<br>> Subject: [plt-scheme] trace forms?
<br>><br>> Hi,<br>><br>> In Chez Scheme, there are trace forms for let and lambda (trace-let,<br>> for example).<br>><br>> It is pretty convenient. Is there something like this in MzScheme?<br>><br>
> How difficult is it to implement something like this?<br>> _________________________________________________<br>> For list-related administrative tasks:<br>> <a href="http://list.cs.brown.edu/mailman/listinfo/plt-scheme">
http://list.cs.brown.edu/mailman/listinfo/plt-scheme</a><br>><br>_________________________________________________<br> For list-related administrative tasks:<br> <a href="http://list.cs.brown.edu/mailman/listinfo/plt-scheme">
http://list.cs.brown.edu/mailman/listinfo/plt-scheme</a><br></blockquote></div><br><br clear="all"><br>-- <br><a href="http://www.yinsochen.com">http://www.yinsochen.com</a><br>...continuous learning...