Marcin 'Qrczak' Kowalczyk wrote:
> And eqv? on symbols should be the same as eq?.
This is the case for normal Scheme symbols in Kawa,
but Kawa uses the same class for XML-ish QNames as well.
A QName can have a local-name, namespace-uri, and a prefix.
The prefix is used for reading and writing XML names, but
does not take part in equality comparisons: Two QNames
are considered equal (in Scheme equal? and eqv?) if their
local-name and namepace-uri match, even if their prefixes
are different.
I'm not sure what is the right way to handle QNames.
Having them be eqv? even if their prefix are differ does
violate the general contract of eqv?. A cleaner alternative
is to view a Qname as prefix "annotation" *combined with*
a symbol interned in a namespace (package). That does waste
memory, since there will usually be many more symbols for a
given (prefix, namespace)-combination that for a given
(namespace, localname)-combination, thus one can use a
single pointer to refer to a (prefix, namespace)-object.
--
--Per Bothner
per_at_bothner.com http://per.bothner.com/
Received on Sat Nov 25 2006 - 00:25:05 UTC