[gambit-list] Debugging

Bradley Lucier lucier at math.purdue.edu
Sat Jan 14 16:39:32 EST 2006


On Jan 14, 2006, at 3:15 PM, Christian wrote:

> Hello
>
> In beta 17, it seems that the leap operation in the debugger still
> doesn't work as it should, right? Can this be fixed?
>
> Ideas on some other things which could be useful for a good debugging
> experience:
>
> - easily redefine functions which have been defined in the interpreter
> to use non-tail calls: something like
>
> (define (function-proper-tail-calls-set! name true?)
>   (let ((code (##decompile (eval name))))
>     (if (pair? code)
> 	(parameterize ((generate-proper-tail-calls true?))
> 	  (eval `(define ,name ,code)))
> 	(error "not an interpreted procedure:" name code))))
>
> ; > (define (f n) (if (<= n 0) (error "fin") (f (- n 1))))
> ; > (f 10)
> ; *** ERROR IN (console)@10.1 -- fin
> ; 1>
> ; ctl-d
> ; > (function-proper-tail-calls-set! 'f #f)
> ; > (f 10)
> ; *** ERROR IN f -- fin
> ; 1>
>
> Ok this works so far, but it would be nice if it would keep location
> information, and probably also if it would act on the lambda itself,
> instead of on one particular binding of the lambda.

Doesn't

(proper-tail-calls-set! #f)

do what you want?  Do this before loading interpreted code you don't  
want to use tail calls.

Brad



More information about the Gambit-list mailing list