fixed bugs in format when given inexact and complex arguments to ~d,

~b, ~x, and ~o.
This commit is contained in:
Abdulaziz Ghuloum 2009-04-06 16:52:11 +03:00
parent 0c96321f20
commit 4ca8b1add2
2 changed files with 8 additions and 17 deletions

View File

@ -693,15 +693,12 @@
(when (null? args)
(die who "insufficient arguments"))
(let ([a (car args)])
(cond
[(or (fixnum? a) (bignum? a) (ratnum? a))
(void)]
[(flonum? a)
(unless (eqv? c #\d)
(die who
(format "flonums cannot be printed with ~~~a" c)))]
[else
(die who "not a number" a)]))
(unless (number? a) (die who "not a number" a))
(unless (or (eqv? c #\d) (exact? a))
(die who
(format "inexact numbers cannot be \
printed with ~~~a" c)
a)))
(f (fxadd1 i) (cdr args))]
[else
(die who "invalid sequence character after ~" c)])))]
@ -731,13 +728,7 @@
=>
(lambda (x)
(let ([a (car args)])
(cond
[(or (fixnum? a) (bignum? a) (ratnum? a))
(display-to-port (number->string a (cdr x)) p)]
[(flonum? a)
(display-to-port (number->string a) p)]
[else
(die who "BUG: not a number" a)]))
(display-to-port (number->string a (cdr x)) p))
(f (fxadd1 i) (cdr args)))]
[else (die who "BUG" c)])))]
[else

View File

@ -1 +1 @@
1752
1753