This is the mail archive of the kawa@sources.redhat.com mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Bug in format!


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 




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]