From: Peter Seibel
Subject: Are all numeric prefix-parameters in FORMAT directives integers?
Date:
Message-ID: <m3hdnci8w5.fsf@javamonkey.com>
It seems like they are but I can't quite find anything in the spec
that says they must be: In 22.3 Formatted Output it says:
Prefix parameters are notated as signed (sign is optional) decimal
numbers, ...
The only FORMAT directive for which a non-integer parameter might make
sense are ~:T in which the parameters are taken as numbers of "ems"
(and since we're talking about ems rather than characters, fractional
ems might make sense) and ~^ in which the 2 and 3-parameter versions
do numeric comparisons. FWIW, Allegro 7.0 thinks "~2.3:T" is an
invalid control string.
-Peter
--
Peter Seibel ·····@javamonkey.com
Lisp is the red pill. -- John Fraser, comp.lang.lisp
From: Christophe Rhodes
Subject: Re: Are all numeric prefix-parameters in FORMAT directives integers?
Date:
Message-ID: <sqact3wo0k.fsf@cam.ac.uk>
Peter Seibel <·····@javamonkey.com> writes:
> It seems like they are but I can't quite find anything in the spec
> that says they must be: In 22.3 Formatted Output it says:
>
> Prefix parameters are notated as signed (sign is optional) decimal
> numbers, ...
>
> The only FORMAT directive for which a non-integer parameter might make
> sense are ~:T in which the parameters are taken as numbers of "ems"
> (and since we're talking about ems rather than characters, fractional
> ems might make sense) and ~^ in which the 2 and 3-parameter versions
> do numeric comparisons.
It's not clear. (I think the 2-parameter version does an equality
comparison, incidentally, not a numeric comparison: "~'a,V^" #\a
should escape.)
> FWIW, Allegro 7.0 thinks "~2.3:T" is an invalid control string.
That might be reasonable. What does it think of (format nil "~V:T"
2.3)?
Christophe
From: Peter Seibel
Subject: Re: Are all numeric prefix-parameters in FORMAT directives integers?
Date:
Message-ID: <m3wtw7gufh.fsf@javamonkey.com>
Christophe Rhodes <·····@cam.ac.uk> writes:
> Peter Seibel <·····@javamonkey.com> writes:
...
>> FWIW, Allegro 7.0 thinks "~2.3:T" is an invalid control string.
>
> That might be reasonable. What does it think of (format nil "~V:T"
> 2.3)?
CL-USER> (format t "~V:T" 2.3)
#<Printer Error, obj=#x71000685: end argument 2.3 is not positive fixnum.>
NIL
-Peter
--
Peter Seibel ·····@javamonkey.com
Lisp is the red pill. -- John Fraser, comp.lang.lisp