* unknown # error message
@ 2003-06-02 23:51 Kevin Ryde
2003-06-04 16:36 ` Kevin Ryde
0 siblings, 1 reply; 2+ messages in thread
From: Kevin Ryde @ 2003-06-02 23:51 UTC (permalink / raw)
[-- Attachment #1: Type: text/plain, Size: 710 bytes --]
This is a followup to my report about the error message for an unknown
"#" object in the reader. (Which I've since managed to lose.)
For instance interactively with the latest cvs,
(call-with-input-string "#Z" read)
gives an exception during display of the error.
* read.c (scm_input_error): Pass arg list parameter to scm_error_scm,
rather than SCM_EOL. Needed by "Unknown # object" case in scm_lreadr.
* tests/reader.test (reading): Test bad # error message is formattable.
I believe this is only in the head, not 1.6. I'm guessing that not
passing the arg parameter to scm_error_scm was merely a typo. It
looks like the intention, and that parameter is otherwise unused.
[-- Attachment #2: read.c.error-args.diff --]
[-- Type: text/plain, Size: 574 bytes --]
--- read.c.~1.90.~ 2003-05-10 10:11:50.000000000 +1000
+++ read.c 2003-06-02 17:08:54.000000000 +1000
@@ -1,4 +1,5 @@
-/* Copyright (C) 1995,1996,1997,1999,2000,2001 Free Software Foundation, Inc.
+/* Copyright (C) 1995,1996,1997,1999,2000,2001,2003 Free Software
+ * Foundation, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -90,7 +91,7 @@
scm_error_scm (scm_str2symbol ("read-error"),
scm_makfrom0str (function),
string,
- SCM_EOL,
+ arg,
SCM_BOOL_F);
}
[-- Attachment #3: reader.test.bad-hash.diff --]
[-- Type: text/plain, Size: 854 bytes --]
--- reader.test.~1.6.~ 2002-08-07 10:52:21.000000000 +1000
+++ reader.test 2003-06-02 17:08:25.000000000 +1000
@@ -18,7 +18,20 @@
(pass-if "1+i+i"
(equal? (read-string "1+i+i") '1+i+i))
(pass-if "1+e10000i"
- (equal? (read-string "1+e10000i") '1+e10000i)))
+ (equal? (read-string "1+e10000i") '1+e10000i))
+
+ ;; At one time the arg list for "Unknown # object: ~S" didn't make it out
+ ;; of read.c. Check that `format' can be applied to this error.
+ (pass-if "error message on bad #"
+ (catch #t
+ (lambda ()
+ (read-string "#ZZZ")
+ ;; oops, this # is supposed to be unrecognised
+ #f)
+ (lambda (key subr message args rest)
+ (apply format #f message args)
+ ;; message and args are ok
+ #t))))
(pass-if-exception "radix passed to number->string can't be zero"
exception:out-of-range
[-- Attachment #4: Type: text/plain, Size: 142 bytes --]
_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: unknown # error message
2003-06-02 23:51 unknown # error message Kevin Ryde
@ 2003-06-04 16:36 ` Kevin Ryde
0 siblings, 0 replies; 2+ messages in thread
From: Kevin Ryde @ 2003-06-04 16:36 UTC (permalink / raw)
I wrote:
>
> * read.c (scm_input_error): Pass arg list parameter to scm_error_scm,
> rather than SCM_EOL. Needed by "Unknown # object" case in scm_lreadr.
>
> * tests/reader.test (reading): Test bad # error message is formattable.
I made this change.
_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-06-04 16:36 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-06-02 23:51 unknown # error message Kevin Ryde
2003-06-04 16:36 ` Kevin Ryde
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).