[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Lisp issues: tracing small recursive functions
I assume all of you realized that the lisp reference that is available
from the class page has good instructions on how to do debugging etc
of lisp. It is definitely worth reading the chapter 2 at least.
One additional point you may want to note is that when lisp compiles a
recursive function, it often converts the tail recursion into
interation (recursion is great for program understanding, but
iteration is better for actual execution). An implication of this is
that if you wrote a small (tail) recursive function, compiled it and
tried to trace it to debug, you may find that it only shows one entry
and exit (and not recursive calls). For debugging such small
functions, you want to load the code in interpreted rather than
compiled mode (one simple way is to cut and paste the function into
the listener).
Once everything is checked out however, you want to compile the whole
file for speed.
Rao