[racket] inspect variable values in backtrace?

From: Fred G. Martin (fredm at cs.uml.edu)
Date: Wed Mar 2 11:16:40 EST 2011

Thanks.

I figured out how to put printf's into my core predicate, using begin
(followed by my predicate-expression).  It turned out that the 3rd (of
the ca. 500) items in my hash table first exercised my error, so now
I'm on my way to fixing it.

Is this what other people do?  Is there a more elegant way?  I guess
printf's are universal?

Fred


On Wed, Mar 2, 2011 at 9:07 AM, Jay McCarthy <jay.mccarthy at gmail.com> wrote:
> The backtrace does not include that information. However, the
> graphical debugger built in DrRacket will do what you'd like. Using it
> can be very time consuming though because it works by annotating your
> program and then running it with many more additional operations. Most
> of my students swear by it (although I have a hard time remembering to
> try it since it wasn't there when I started with Racket.)
>
> Jay
>
> 2011/3/2 Fred G. Martin <fredm at cs.uml.edu>:
>> Hi all,
>> Is it possible to see the bindings of various things in a backtrace?  I am
>> having trouble debugging my code because I'm not sure which input is causing
>> it to fail -- at some point, I'm trying to take the car of an empty list.
>>  The outer thing is a for-each mapping over a hash table with about 500
>> entries, and I'm not sure which entry is causing my inner stuff to break.
>> Can't use printf, right?... any advice?
>> thanks,
>> Fred
>>
>>
>> _________________________________________________
>>  For list-related administrative tasks:
>>  http://lists.racket-lang.org/listinfo/users
>>
>
>
>
> --
> Jay McCarthy <jay at cs.byu.edu>
> Assistant Professor / Brigham Young University
> http://faculty.cs.byu.edu/~jay
>
> "The glory of God is Intelligence" - D&C 93
>



Posted on the users mailing list.