Nikodemus Siivola <nikodemus@...> writes:
> On Sat, 26 Mar 2005, Friedrich Dominicus wrote:
>
>>> Then cl-xml should be fixed not to assume that "" is a nickname for
>>> the keyword package.
>
>> (eq '||::isbn '||::isbn)
>
>> I do not now how this is read by the Reader, just it just give an
>> error message with SBCL. This is why I asked.
>
> This is because the implementations you cited have "" as a nickname
> for the KEYWORD package, which is definitely not guaranteed by the
> standard, and possibly forbidden.
>
> Since SBCL doesn't do this, reading the above form signals the error
> due to package "" not existing. So: it's a feature in SBCL and a bug
> in cl-xml.
Hmmm. I'm not sure I buy that--per Section 2.2 Reader Algorithm it
seems to me that reading the following two sequences of characters
::isbn
||::isbn
should be read the same as tokens, regardless of whether "" is a
nickname for the keyword package. Here's my reasoning:
- Start in step 1. Not at end of file so go to Step 7 because #\: is
a constituent character.
- In Step 7 begin reading a token with #\: as the first character. Go
to step 8.
- In Step 8 loop collecting the characters #\:, #\i, #\s, #\b, and
#\n. When we read the whitespace or terminating macro character
after #\b go to Step 10 where the token is converted to an object.
To read ||::isbn we follow a slightly different path but with the same
resulting token.
- Start in step 1. Not at end of file so go to Step 9 because #\| is
a multiple escape character.
- In Step 9, read the next character, a #\| and go to Step 8.
- In Step 8 loop collecting the characters #\:, #\:, #\i, #\s, #\b,
and #\n. When we read the whitespace or terminating macro
character after #\b goto Step 10.
In Step 10 the token token "::isbn" is converted to an object.
However, according to the rules in 2.3.5, "::aaaa" is an undefined
pattern for the name of a symbol so SBCL can legitimately signal an
error.
However SBCL (0.8.16 anyway) signals an error when reading ||:isbn
which seems wrong according to Sections 2.2 and 2.3.5. So if CL-XML
really contains tokens written as either ||::isbn *or* ::isbn it is a
bug in CL-XML. But if CL-XML contains ||:isbn, I'd say that SBCL is
wrong to signal an error when reading those tokens. Or maybe I'm
missing something.
-Peter
--
Peter Seibel peter@...
Lisp is the red pill. -- John Fraser, comp.lang.lisp
|