This is the mail archive of the
kawa@sources.redhat.com
mailing list for the Kawa project.
Bug in format!
- To: kawa at sourceware dot cygnus dot com
- Subject: Bug in format!
- From: Jocelyn Paine <popx at pop3 dot ifs dot org dot uk>
- Date: Sat, 6 Oct 2001 18:57:59 +0100 (GMT)
Define
(define (x-times (n <int>)) <string>
(if (eq? n 0)
""
;else
(string-append "x" (x-times (- n 1)))
)
)
i.e. it generates a string of n x's.
Then call
(format "~S" (x-times 125))
It crashes:
java.lang.NullPointerException:
at gnu.text.PrettyWriter.outputPartialLine(PrettyWriter.java:982)
at gnu.text.PrettyWriter.ensureSpaceInBuffer(Compiled Code)
at gnu.text.PrettyWriter.write(Compiled Code)
at java.io.PrintWriter.write(Compiled Code)
at java.io.PrintWriter.write(Compiled Code)
at gnu.mapping.OutPort.write(Compiled Code)
at java.io.PrintWriter.print(Compiled Code)
at gnu.mapping.OutPort.print(Compiled Code)
at gnu.lists.Strings.printQuoted(Compiled Code)
at gnu.mapping.SFormat.print(Compiled Code)
But trying to output only 124 x's succeeds.
This sounds like the bug in call-with-output-string reported on 30 Sep
2001.
Any circumvention recommended?
Jocelyn Paine
http://www.ifs.org.uk/~popx/
+44 (0)7768 534 091