Subject: [clisp-list] Debugging in Clisp

From: Nick Wright <[email-masked]>
Date: Thu Jan 16 20:25:03 2003

Hi everyone,

Is there a good documentation for the debugging features of Clisp?

I am currently working with a system that I am trying to run under 
Clisp, but which was written primarily for another lisp system. Minor 
differences between these lisps mean that I am having to make slight 
changes to the code to get things working.

My problem is that I am faced with the following error message:

*** - FUNCALL: the function T is undefined

How can I find out where funcall was called from and what it's arguemnt 
was?

(trace funcall) doesn't seem to work in this instance.

I have tried stepping through the top level function call - 
unfortunately, the system I'm working on is rather compicated, meaning 
that stepping through one step at a time is going to take a very long time.

What I want to be able to do is to interrupt the execution just before 
the error occurs to see what the state of the system is there, and what 
the local variables are at that point.

I am fammiliar with the breakpoint options. This tells me about "frames" 
and on printing these I get some variables, but generally not the ones 
I'm interested in.

Is there a concice documentation on whats going on in the "frames" or 
what I can expect to achieve through the debugging system?

Any other suggestions?

Thanks,

Nick.

---

From: Sam Steingold <[email-masked]>
Date: Fri Jan 17 11:38:05 2003

> * In message <[email-masked]>
> * On the subject of "[clisp-list] Debugging in Clisp"
> * Sent on Fri, 17 Jan 2003 17:22:04 +1300
> * Honorable Nick Wright <[email-masked]> writes:
>

<http://clisp.cons.org/impnotes/environment.html#debugger>

> How can I find out where funcall was called from and what it's
> arguemnt was?

type "where" at the debugging prompt.
you will get more information if your code is interpreted and not
compiled.
type "help" for help.

> (trace funcall) doesn't seem to work in this instance.

it should work - but will not necessarily help you.

(t) does not call FUNCALL but will report this error.

-- 
Sam Steingold (http://www.podval.org/~sds) running RedHat8 GNU/Linux
<http://www.camera.org> <http://www.iris.org.il> <http://www.memri.org/>
<http://www.mideasttruth.com/> <http://www.palestine-central.com/links.html>
What's the difference between Apathy & Ignorance? -I don't know and don't care!

---

From: Kaz Kylheku <[email-masked]>
Date: Fri Jan 17 12:49:02 2003

> (t) does not call FUNCALL but will report this error.

This calls for Lisp humor:

  ;;; cond bug smoother for dummies

  (defun t (&rest oops)
    (cond
      ((null oops) t)
      ((t (first (last oops))))))

My original version was

  (defun t (&rest oops) 
    (first (last (cons t oops))))

but the lengthier formulation contains the all-important element of
irony.

Binding a function to t is probably like so not-ANSI-conforming, dudes.
Avoid inhaling the fumes, use proper ventilation, etc.