Frode Vatvedt Fjeld <frodef@cs.uit.no> wrote:
+---------------
| Steven Haflich <smh@alum.mit.edu> writes:
| > However, eql in typical implementations is a rather more expensive
| > operation than eq in the false case. That is sufficient reason for
| > using eq when the arguments are known not to be numbers or
| > characters.
|
| This was my conclusion also, the last time this was discussed here,
| maybe a couple of years ago: Treat EQ as a shortcut for something
| approximately like
| (eql (the (not (or number character)) x)
| (the (not (or number character)) y))
+---------------
Conversely, one may hope that the implementation of EQL is always
at *least* as good as this:
(or (eq x y)
(and (characterp x) (characterp y) (char= x y))
(and (numberp x) (numberp y) (= x y)))
which isn't actually all that slow except for the leaf cases
of "char=" with hugely-complex Unicode and "=" with bignums.
-Rob
-----
Rob Warnock <rpw3@rpw3.org>
627 26th Avenue <URL:http://rpw3.org/>
San Mateo, CA 94403 (650)572-2607