[Bug-openmcl] #\+ in format directives patch

bryan o'connor bryan-openmcl at lunch.org
Wed Dec 8 00:29:10 MST 2004


i didn't find exactly where the spec says that digits in format
strings can be written with a sign when positive, but the ansi
test suite was updated recently to check for it..  regardless,
it's probably a good thing to allow.

current behavior --

? (format nil "~10D" 300)
"       300"
? (format nil "~-10D" 300)
"300"

patch adds this --

? (format nil "~+10D" 300)
"       300"



	...bryan


-------------- next part --------------
Index: level-1/l1-format.lisp
===================================================================
RCS file: /usr/local/tmpcvs/ccl-0.14-dev/ccl/level-1/l1-format.lisp,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 l1-format.lisp
*** level-1/l1-format.lisp	19 Oct 2003 08:57:10 -0000	1.1.1.1
--- level-1/l1-format.lisp	8 Dec 2004 06:57:05 -0000
***************
*** 95,101 ****
                       (go NEXT))
                      ((or (eq char #\V) (eq char #\v))
                       (push (pop-format-arg) params))
!                     ((or (eq char #\-) (digit-char-p char))
                       (let ((start (%i- i 1)) n)
                         (loop
                           (when (= i length) (go EOF-ERROR))
--- 95,101 ----
                       (go NEXT))
                      ((or (eq char #\V) (eq char #\v))
                       (push (pop-format-arg) params))
!                     ((or (eq char #\-) (eq char #\+) (digit-char-p char))
                       (let ((start (%i- i 1)) n)
                         (loop
                           (when (= i length) (go EOF-ERROR))
-------------- next part --------------



More information about the Bug-openmcl mailing list