[gambit-list] Debugging techniques
Marc Feeley
feeley at iro.umontreal.ca
Fri Oct 7 09:52:01 EDT 2016
Note that generate-proper-tail-calls only works in the interpreter. Moreover, the documentation says about generate-proper-tail-calls:
[Note: this procedure is DEPRECATED and will be removed
in a future version of Gambit. Use the proper-tail-calls
declaration instead.]
The declaration works in interpreted and compiled code.
Marc
> On Oct 7, 2016, at 9:24 AM, Bradley Lucier <lucier at math.purdue.edu> wrote:
>
> 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
>
> _______________________________________________
> Gambit-list mailing list
> Gambit-list at iro.umontreal.ca
> https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list
More information about the Gambit-list
mailing list