Subject: [clisp-list] Verbose trapped error messages

From: Adam Warner <[email-masked]>
Date: Sun Sep 22 03:44:03 2002

Hi all,

I'm just a little stuck on how to turn an error condition that I have
trapped that looks like this:

#<system::simple-unbound-variable #x203F499D>

Into something meaningful like "variable TEST has no value at line xxx"

I'm currently using this code:

(handler-case
   (eval code)
   (serious-condition (error)
		      (format t "EVAL error: ~S" error)))

For example if I try this in CLISP:

[1]> (+ A 1)
*** - EVAL: variable A has no value

Compare the error message above to:

[3]> (setf code '(+ A 1))
(+ A 1)
[4]> (handler-case
   (eval code)
   (serious-condition (error)
                      (format t "EVAL error: ~S" error)))
EVAL error: #<SYSTEM::SIMPLE-UNBOUND-VARIABLE #x20455345>
NIL

Many thanks,
Adam

---

From: Sam Steingold <[email-masked]>
Date: Mon Sep 23 06:39:03 2002

> * In message <1032691720.2449.18.camel@work>
> * On the subject of "[clisp-list] Verbose trapped error messages"
> * Sent on 22 Sep 2002 22:48:40 +1200
> * Honorable Adam Warner <[email-masked]> writes:
>
> [4]> (handler-case
>    (eval code)

try (format t "EVAL error: ~A" error)

-- 
Sam Steingold (http://www.podval.org/~sds) running RedHat7.3 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>
Why do we want intelligent terminals when there are so many stupid users?