Re: Debugging REPL

<[email protected]> Tue, 12 Jun 2007 13:25:18 +0000
Newsgroups gmane.comp.java.sisc.user
Message-ID <[email protected]>
Daniel,

although I use Gambit-C instead of SISC (mainly for its debugging 
capabilities), I use SchemeScript exactly as you described. In fact, 
SchemeScript was developed with this editing style in mind.

Cheers,
Dominique

P.S. I put the macro on my blog, if you don't mind.

>I found a workaround:
>
>(define-syntax debug
>   (syntax-rules ()
>     ((_ var ...)
>      (begin
>        (print "Debugging. Available lexical bindings: " '(var) ...)
>        (putprop 'var (make-child-environment (interaction-environment)) 
>var) ...
>        (repl)
>        (print "Debugging ended.")))))
>
>This special syntactic form can be used like this:
>
>(define (f x)
>   (let ((sq (* x x)))
>     (debug x sq)
>     (+ sq sq)))
>
>Does anyone know a better solution?
>
>Btw, I use the SchemeScript IDE and really like the editing style that
>is made possible with the above debug-form. You can put "(debug
>some-vars)" inside a procedure and execute it (or some other procedure
>that calls it). Then, with access to the local variables, you can
>write your code inside the procedure -- right in place -- and evaluate
>by pressing Ctrl+Enter. If finished, you exit the debug REPL.
>I'm interested, what is you preferred "editing cycle"?
>
>Best regards
>Daniel Sadilek



-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/