The CLHS says in the entry on the ~F FORMAT directive:
if the arg is not negative, then a plus sign is printed if and only
if the @ modifier was supplied
Yet three out of four Lisp implementations surveyed do not print the
plus sign. E.g.
(format nil ··@f" 10) => "10.0"
in Allegro 7.0, SBCL, and CMUCL. CLISP on the other hand gets this
"right". All four add a plus sign when the @ modifier is given to the
~E directive. Is there something I'm missing here or are all those
implementations, except for CLISP, out of conformance?
-Peter
--
Peter Seibel ·····@javamonkey.com
Lisp is the red pill. -- John Fraser, comp.lang.lisp
>>>>> "Peter" == Peter Seibel <·····@javamonkey.com> writes:
Peter> The CLHS says in the entry on the ~F FORMAT directive:
Peter> if the arg is not negative, then a plus sign is printed if and only
Peter> if the @ modifier was supplied
Peter> Yet three out of four Lisp implementations surveyed do not print the
Peter> plus sign. E.g.
Peter> (format nil ··@f" 10) => "10.0"
Peter> in Allegro 7.0, SBCL, and CMUCL. CLISP on the other hand gets this
Peter> "right". All four add a plus sign when the @ modifier is given to the
CMUCL 19a doesn't produce the plus sign, but it is fixed in the
snapshots to produce a plus sign. (Quite a few format bugs found in
the ansi-tests have been fixed in the snapshots. Many more remain,
unfortunately.)
Ray
> >>>>> "Peter" == Peter Seibel <·····@javamonkey.com> writes:
Peter> The CLHS says in the entry on the ~F FORMAT directive:
Peter> if the arg is not negative, then a plus sign is printed if and only
Peter> if the @ modifier was supplied
Peter> Yet three out of four Lisp implementations surveyed do not print the
Peter> plus sign. E.g.
Peter> (format nil ··@f" 10) => "10.0"
Peter> in Allegro 7.0, SBCL, and CMUCL. CLISP on the other hand gets this
Peter> "right". All four add a plus sign when the @ modifier is given to the
FWIW, MCL gets it right.
--
Thomas A. Russ, USC/Information Sciences Institute
Peter Seibel wrote:
> The CLHS says in the entry on the ~F FORMAT directive:
>
> if the arg is not negative, then a plus sign is printed if and only
> if the @ modifier was supplied
>
> Yet three out of four Lisp implementations surveyed do not print the
> plus sign. E.g.
>
> (format nil ··@f" 10) => "10.0"
>
> in Allegro 7.0, SBCL, and CMUCL. CLISP on the other hand gets this
> "right". All four add a plus sign when the @ modifier is given to the
> ~E directive. Is there something I'm missing here or are all those
> implementations, except for CLISP, out of conformance?
On LW:
CL-USER 15 > (format nil ··@f" 10.0)
"10.0"
CL-USER 16 > (format nil "~,·@f" 10.0)
"+10.0"
ON CMUCL: (Same Thing)
* (format nil "~,·@F" 10)
"+10.0"
* (format nil ··@F" 10)
"10.0"
Methinks they have a common ancestor.
Wade
In article <····················@clgrps12>,
Wade Humeniuk <····················@telus.net> wrote:
> Peter Seibel wrote:
> > The CLHS says in the entry on the ~F FORMAT directive:
> >
> > if the arg is not negative, then a plus sign is printed if and only
> > if the @ modifier was supplied
> >
> > Yet three out of four Lisp implementations surveyed do not print the
> > plus sign. E.g.
>
> On LW:
>
> CL-USER 15 > (format nil ··@f" 10.0)
> "10.0"
>
> CL-USER 16 > (format nil "~,·@f" 10.0)
> "+10.0"
Same behavior on MCL 4.3 (it's an old machine...)