Subject: [clisp-list] RFE: parse-integer error message

From: "Hoehle, Joerg-Cyril" <[email-masked]>
Date: Thu Feb 13 08:42:06 2003

Hi,

Sam wrote:
>> *** - PARSE-INTEGER: string "un" does not have integer syntax
>> would be much more precise and correct.

>but it will leave you wondering where you pass this string to
>PARSE-INTEGER.
There's always backtrace-1 while in the debugger.

>what about
>substring "un" (125:127) does not have integer syntax
Hmm, the (x:y) notation is not standard in Common Lisp at all
(nor [125:127], nor [125,127[, nor anything I can now think of), so
people may start wondering what this is supposed to mean.
A quote into the Holy Bible?

Indicating "Substring" is enough (if not too much already) IMHO.
Or
"un" from (SUBSEQ _/?/X/foo/STRING 125 127) does not have integer syntax.
But then people may start wondering where that SUBSEQ comes from, because it's not in their code.

>(we can also add a slot to PARSE-ERROR which will contain the 
>whole string)
No problem.

I don't really care about the slots -- I never used any of the condition objects except maybe for type-error [*], but you're welcome to provide a sound set of slots, consistent in its accuracy with the rest of CLISP.

What I care about is precise error messages. So a precise (and concise) message is fine with me.

[*] In one of our systems, we had >100 conditions defined. It turned out we never used that mass, in the sense that no error-handler was ever installed for >95% of them. So defining them and having them raised at appropriate places was a significant wasted effort, in retrospect.
That's my experience. It made the source code raising the error more concise, though. Especially all error text messages were moved away. This, however, rose questions about coherence: "is the message text in file foo still in sync with the code in bar?"

The few exceptions that we caught were of the file-not-found kind, where we wanted a restart handler.
That's why I don't, for my part, put much value into many error classes and their slots. Yet I use error-handlers and restarts.

Regards,
	Jorg Hohle.