[imp-hackers] ansi test issues

Sam Steingold sds at gnu.org
Thu Jul 9 15:08:54 UTC 2009


On Thu, Jul 9, 2009 at 10:45 AM, Juan Jose
Garcia-Ripoll<juanjose.garciaripoll at googlemail.com> wrote:
> On Thu, Jul 9, 2009 at 4:02 PM, Sam Steingold<sds at gnu.org> wrote:
>> E.g., consider print-level.[89]
>> the text and examples in
>>  http://www.lispworks.com/documentation/HyperSpec/Body/v_pr_lev.htm
>> seem to indicated that
>> (write-to-string #S(foo) :print-level 0)
>> should return "#" and not "#S(foo)" as the tests mandate.
>>
>> In fact, I argue that this is a case where the test is _wrong_ as
>> opposed to two possible return values being both acceptable.
>
> You mean that the following two cases are not consistent, or that the
> first one is allowed both to be # or #S(FOO) ?
>
>> (defstruct foo)
>> (let ((*print-level* 0)) (write-to-string #S(foo)))
> "#S(FOO)"
>> (defstruct foo a b)
>> (let ((*print-level* 0)) (write-to-string #S(foo)))
> "#"

I think that the first of the above output is inconsistent both with
the second one and with
> (write-to-string #() :level 0)
==> "#"

> Probably the question is when is a structure understood to have
> elements and be a composed object and when not.  I see CLISP prints #
> in the first case, ECL and SBCL print #S(FOO).

something "printed with a list-like syntax" is, IMO, assumed to have
components, even if the actual set of the components is empty, like
with #() or #S(FOO).

-- 
Sam Steingold <http://sds.podval.org>




More information about the implementation-hackers mailing list