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

From: "Hoehle, Joerg-Cyril" <[email-masked]>
Date: Thu Feb 13 04:19:04 2003

This is a request for enhancement that I prefer to submit to the list for discussion.

parse-integer error messages do not combine nicely with using :start
and :end, witness the following error message:

(parse-integer line :start 5 :end 7)
*** - PARSE-INTEGER: string "6;28Jun2002;23:59:15;10.3.1.5;log;accept;;zorg;inbound;icmp;10.4.1.3;192.68.1.5;1434;3813;404;95;;;;;;;;;;;;;;;;;;;;;;;;;;;firewall;;;;" does not have integer syntax

The whole string argument is shown, and we don't know where exactly
(as delimited by START and END) PARSE-INTEGER was looking for a
match.

Suggestion: Using (SUBSEQ string start end) instead of the whole
original string would be useful when *signaling* the error.

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

This can become especially important as I intend to make heavy use of
:start and :end keywords on a 256KB large string. Imagine this huge
string output as part of the error message and stored into the
application's errorlog each time parse-integer complains!
I'd currently obtain a logfile of size (* 2486 (+ 50 (* 256 1024))), half a gigabyte for 2486 occurrences...

Cost to implementors: tiny
Run-time cost in case of no error: 0
Run-time cose in case of error: 1 additional SUBSEQ

What do you think?
	Jörg Höhle.

---

From: Sam Steingold <[email-masked]>
Date: Thu Feb 13 07:04:12 2003

> * In message <[email-masked]>
> * On the subject of "[clisp-list] RFE: parse-integer error message"
> * Sent on Thu, 13 Feb 2003 13:18:30 +0100
> * Honorable "Hoehle, Joerg-Cyril" <[email-masked]> writes:
>

but it will leave you wondering where you pass this string to
PARSE-INTEGER.

> Run-time cose in case of error: 1 additional SUBSEQ

what about

substring "un" (125:127) does not have integer syntax

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

-- 
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>
A man paints with his brains and not with his hands.

---

From: "Coby Beck" <[email-masked]>
Date: Fri Feb 14 01:23:08 2003

> but it will leave you wondering where you pass this string to

That's a good point.

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

This sounds like a very reasonable plan to me.

Coby Beck
(remove #\Space "coby 101 @ bigpond . com")