Daniel Brunner <brunner@...> writes:
> * (type-of (symbol-name :key))
> (SIMPLE-BASE-STRING 3)
> * (type-of (symbol-name :blah))
> (SIMPLE-ARRAY CHARACTER (4))
> It seems that the "builtin" keyword symbols evaluate to
> SIMPLE-BASE-STRING whereas "new" keyword symbols evaluate to SIMPLE-ARRAY.
Well, that's a bit of a misleading summary, in the sense that
SIMPLE-BASE-STRING is a subtype of SIMPLE-ARRAY. What you're seeing,
though, is the result of the fact that in SBCL there are two disjoint
string representations: one which can hold any kind of character
(SIMPLE-ARRAY CHARACTER (*)), and one which can hold only base-chars
(SIMPLE-ARRAY BASE-CHAR (*)) == SIMPLE-BASE-STRING.
> (cxml:with-xml-output (cxml:make-string-sink) (cxml:with-element
> (string-downcase (symbol-name :key))))
> raises a type error.
I think that the definition of RUNES:ROD in closure-common's
characters.lisp is buggy: I think that instead of the first clause in
the cond, (stringp x), it should be something like the following two
clauses ((typep x 'rod) x) ((stringp x) (coerce x 'rod))
> Is this behaviour "normal" or intended? (I tested that on Clozure CL and
> there both strings have the same type SIMPLE-BASE-STRING.
The behaviour is normal, intended and permitted by the standard.