[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Comments and some bugs

This page is part of the web mail archives of SRFI 54 from before July 7th, 2015. The new archives for SRFI 54 contain all messages, not just those from before July 7th, 2015.



 * From: Jens Axel Søgaard <jensaxel@xxxxxxxxxxxx>
 * Date: Wed, 24 Mar 2004 17:51:10 +0100
 * Subj: Re: Comments and some bugs

 > (fmt -5.0 0 #\space 10 + 'e)
 | . fmt: exact number cannot have a decimal point
 | 10 depth (and depth (eq? exactness (quote e)))    ; Why not?

 > (fmt -5 0 #\space 10 + 'e)
 | . fmt: exact number cannot have a decimal point 10 depth (and depth (eq? exactness (quote e)))

R5RS says: If the written representation of a number has no exactness prefix,
the constant may be either inexact or exact.  It is inexact if it contains a
decimal point, an exponent, or a "#" character in the place of a digit,
otherwise it is exact.

 > (fmt 1/2 5 0)
 | "   1."            ; Huh?

 > (fmt -1 10 0)
 | "       -1."       ; Is this on purpose?

Yes, it expresses that -1. is inexact number.

 > (fmt 1/2 5 2 10)
 | . fmt: bad argument (10) (null? (10))  ; strange error messages

 > (fmt 1/2 5 2 #\space 10)
 | . fmt: bad argument (10) (null? (10))

 | -- 
 | Jens Axel Søgaard

If you test it with currently uploaded draft, you will see the following.
Error: fmt: bad argument
       (10)
       str-list
       (not (every string? str-list))
This means the 10 must be a string.  FMT has only 2 numeric optional
arguments, that is, <width> and <depth> or <width> and <count>.

(fmt 1/2 5 2 #\space (fmt 10))           " 0.5010"
(fmt 1/2 5 2)                            " 0.50"
The default value of padding character is #\space.

Thanks

-- 
INITERM

-- 
INITERM