One of great features in lisp is, I think, Trace. In order to debug a
function in isolation, you just simply set Trace to the function, copy
& paste the trace message, and execute only the function. In that way,
you can solely focus on the function with the buggy inputs. A problem
that I have now is when I trace a function which takes a hash table.
Trace shows the address of the hash table passed into the function,
and I don't know how to call the function with the address of the hash
table shown by Trace. I guess some of you might run into this problem
if you use hash tables a lot. If you know any way or tip, please
enlighten me.
In article <························@g12g2000prg.googlegroups.com>,
onue5 <·······@gmail.com> wrote:
> One of great features in lisp is, I think, Trace. In order to debug a
> function in isolation, you just simply set Trace to the function, copy
> & paste the trace message, and execute only the function. In that way,
> you can solely focus on the function with the buggy inputs. A problem
> that I have now is when I trace a function which takes a hash table.
> Trace shows the address of the hash table passed into the function,
> and I don't know how to call the function with the address of the hash
> table shown by Trace. I guess some of you might run into this problem
> if you use hash tables a lot. If you know any way or tip, please
> enlighten me.
* you can STEP through the execution. The IDE will
let you inspect the data.
* you can print all your hashtables to a list and look up the
hashtable by printed id ;-)
* You can use a CLIM listener or a Lisp machine listener, there you
can click on the printed data and use it
* You could request that presentations in traces work
with SLIME.
* you can set a break point and inspect the hashtable
* in some TRACE implementations it might be possible
to push the call and its args on to a list
* LispWorks has a 'trace tool' that shows you the
calls and the data - and lets you access those.
Menu: >Window>Tools>Tracer
http://www.lispworks.com/documentation/lw50/CLWUG-M/html/clwuser-m-181.htm#pgfId-871610
--
http://lispm.dyndns.org
(message (Hello 'onue5)
(you :wrote :on '(Thu, 02 Aug 2007 09:46:17 -0700))
(
o> you can solely focus on the function with the buggy inputs. A problem
o> that I have now is when I trace a function which takes a hash table.
o> Trace shows the address of the hash table passed into the function,
o> and I don't know how to call the function with the address of the hash
you can try other lisp implementation -- clisp prints hash table contents by
default.
sbcl will print hash table when you set *print-readably* to t. you can try
that with your implementation-- it will barf if it's not possible.
(but note that if your ht is big it will be quite a lot of data :)
)
(With-best-regards '(Alex Mizrahi) :aka 'killer_storm)
"choose no life")