unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* [Patch] format ~F does not maintain the column counter properly
@ 2003-02-27 13:37 Matthias Koeppe
  2003-03-19 19:23 ` Marius Vollmer
  0 siblings, 1 reply; 2+ messages in thread
From: Matthias Koeppe @ 2003-02-27 13:37 UTC (permalink / raw)


Here is a new test for the (ice-9 format) test suite, which fails in
current Guile.  A patch that fixes the bug is attached below.

BTW, format.scm mentions an upstream test suite for format.scm
(formatst.scm).  It might be a good idea to find it and add it to
Guile's test suite.

Matthias

--- format.test.~1.1.~	Sat Jun 16 22:11:39 2001
+++ format.test	Thu Feb 27 14:23:57 2003
@@ -1,7 +1,7 @@
 ;;;; format.test --- test suite for Guile's CL-ish format  -*- scheme -*-
 ;;;; Matthias Koeppe <mkoeppe@mail.math.uni-magdeburg.de> --- June 2001
 ;;;;
-;;;; 	Copyright (C) 2001 Free Software Foundation, Inc.
+;;;; 	Copyright (C) 2001, 2003 Free Software Foundation, Inc.
 ;;;; 
 ;;;; This program is free software; you can redistribute it and/or modify
 ;;;; it under the terms of the GNU General Public License as published by
@@ -36,4 +36,6 @@
 		(format #t "~&abc")
 		(format #f "~&")	; shall have no effect
 		(format #t "~&~&")))
-	    "xyz\nabc\n")))
+	    "xyz\nabc\n"))
+  (pass-if "format ~F (format-out-substr) maintains the column correctly"
+	   (= (string-length (format "~@F~20T" 1)) 20)))

2003-02-27  Matthias Koeppe  <mkoeppe@mail.math.uni-magdeburg.de>

	* format.scm (format:out-substr): Update the column counter
	correctly. This fixes the behavior of ~T (tabbing) after ~F, for
	instance. 

--- format.scm.~1.11.2.1.~	Tue Jan  8 15:12:18 2002
+++ format.scm	Thu Feb 27 14:20:15 2003
@@ -94,7 +94,7 @@
   (do ((k i (+ k 1)))
       ((= k n))
     (write-char (string-ref str k) format:port))
-  (set! format:output-col (+ format:output-col n)))
+  (set! format:output-col (+ format:output-col (- n i))))
 
 ;(define (format:out-fill n ch)       ; this allocates a new string
 ;  (format:out-str (make-string n ch)))


-- 
Matthias Köppe -- http://www.math.uni-magdeburg.de/~mkoeppe


_______________________________________________
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: [Patch] format ~F does not maintain the column counter properly
  2003-02-27 13:37 [Patch] format ~F does not maintain the column counter properly Matthias Koeppe
@ 2003-03-19 19:23 ` Marius Vollmer
  0 siblings, 0 replies; 2+ messages in thread
From: Marius Vollmer @ 2003-03-19 19:23 UTC (permalink / raw)
  Cc: guile-devel

Matthias Koeppe <mkoeppe@mail.math.uni-magdeburg.de> writes:

> Here is a new test for the (ice-9 format) test suite, which fails in
> current Guile.  A patch that fixes the bug is attached below.

Thanks!  It has been applied.

> BTW, format.scm mentions an upstream test suite for format.scm
> (formatst.scm).  It might be a good idea to find it and add it to
> Guile's test suite.

Yes.

-- 
GPG: D5D4E405 - 2F9B BCCC 8527 692A 04E3  331E FAF8 226A D5D4 E405


_______________________________________________
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-03-19 19:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-02-27 13:37 [Patch] format ~F does not maintain the column counter properly Matthias Koeppe
2003-03-19 19:23 ` Marius Vollmer

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).