[gambit-list] Debugging techniques

Bradley Lucier lucier at math.purdue.edu
Fri Oct 7 09:24:25 EDT 2016


On 10/07/2016 09:18 AM, Bradley Lucier wrote:
> What I try to do is debug the code in the interpreter and set
>
>> (generate-proper-tail-calls #f)

Sorry, I should have said that you have to do this before loading any code.

Brad

>
> Then you'll find, e.g.,
>
>> (define (f n)
>   (if (= n 0)
>       (/ 1 n)
>       (f (- n 1))))
>> (f 5)
> *** ERROR IN f, (console)@11.7 -- Divide by zero
> (/ 1 0)
> 1> ,b
> 0  f (console)@11:7                                              (/ 1 n)
> 1  f (console)@12:7                                              (f (- n
> 1))
> 2  f (console)@12:7                                              (f (- n
> 1))
> 3  f (console)@12:7                                              (f (- n
> 1))
> 4  f (console)@12:7                                              (f (- n
> 1))
> 5  f (console)@12:7                                              (f (- n
> 1))
> 6  (interaction)
> (console)@13:1                                              (f 5)
> 1>
>
> Brad



More information about the Gambit-list mailing list