Zach Beane <xach@xach.com> wrote:
+---------------
| pjb@informatimago.com (Pascal J. Bourguignon) writes:
| > KEYWORD is an exception in that the package name is optional in the
| > fully qualified notation:
| > KEYWORD:ANY-SYMBOL
| > KEYWORD::ANY-SYMBOL
| > :ANY-SYMBOL
| > ::ANY-SYMBOL
| > is the same keyword.
|
| Here's a tangent, which I point out because I only recently learned of
| it myself, from 2.3.5:
| The valid patterns for tokens are summarized in the next figure. [2-17]
...
| ::aaaaa undefined
...
| That is, the syntax "::ANY-SYMBOL" is undefined,
| not necessarily a reference to the keyword :ANY-SYMBOL.
+---------------
While the CLHS certainly does say that,
CLISP & CMUCL *do* both support that pattern:
cmu> ::foo
:FOO
cmu>
which is fine, since CLHS 2.3.5 item #5 explicitly *permits* this:
5. The consequences are unspecified if any other pattern of
package markers in a token is used. All other uses of package
markers within names of symbols are not defined by this
standard but are reserved for implementation-dependent use.
Similarly, both CLISP & CMUCL reject :::FOO.
cmu> (princ (nth-value 1 (ignore-errors (read-from-string ":::foo"))))
Reader error at 3 on #<String-Input Stream>:
too many colons after #<The KEYWORD package, 0/2 internal,
1795/2187 external> name
#<READER-ERROR {4895FFDD}>
cmu>
I'm guessing that most CLs do the same as CLISP & CMUCL do here.
-Rob
-----
Rob Warnock <rpw3@rpw3.org>
627 26th Avenue <URL:http://rpw3.org/>
San Mateo, CA 94403 (650)572-2607