From: Sam Steingold
Subject: ANSI CL spec question: FORMAT ~f 'symbol
Date: 
Message-ID: <uk842p7pf.fsf@xchange.com>
What should the following form return:

(FORMAT NIL "~5,3F" 'A)

"A"        (CLISP, LispWorks)
"    A"    (CormanLisp, Allegro)
"A    "    (CMUCL)
type error (GCL) - obviously wrong

Thanks!

-- 
Sam Steingold (http://www.podval.org/~sds)
C combines the power of assembler with the portability of assembler.
From: Barry Margolin
Subject: Re: ANSI CL spec question: FORMAT ~f 'symbol
Date: 
Message-ID: <_BjH6.19$bw.1375@burlma1-snr2>
In article <·············@xchange.com>, Sam Steingold  <···@gnu.org> wrote:
>What should the following form return:
>
>(FORMAT NIL "~5,3F" 'A)
>
>"A"        (CLISP, LispWorks)
>"    A"    (CormanLisp, Allegro)
>"A    "    (CMUCL)
>type error (GCL) - obviously wrong

It should be the same as

(FORMAT NIL "~5D" 'A)

The spec is a bit ambiguous about how this is padded, though.  The
description of ~D (and ~F as well) says that the output is padded on the
left.  But then it says that if the argument is not an integer, it's
printed in ~A format.  There are several possible interpretations of this:

1) Pad as ~D specifies (on the left) then print the printed representation
as ~A does.  This is what CormanLisp and Allegro do.
2) Output everything as if ~5A had been used, thus padding on the right.
This is what CMUCL does.
3) Output everything as if ~A had been used, i.e. discard the width
specification.  This is what CLISP and LispWorks do.

I doubt that (3) was what was intended, as it seems wrong to ignore a field
width.  (1) has the feature that everything in that column, numbers and
non-numbers, will line up nicely on the right, so it seems like the
intuitively right thing.

-- 
Barry Margolin, ······@genuity.net
Genuity, Burlington, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.