[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

EQ



re: The only purpose for retaining EQ as opposed to EQL is storage management,
    or words to that effect...
 
The basic reason for the existence of EQ, as I see it, is to compare interned
symbols.  LISP is a symbol processing language primarily because the comparison
of non-arithmetic quantities is optimized by insuring that the expensive part
is done at symbol creation time (i.e. interning) and all subsequent tests are
very fast (address comparisons).  Now, it is true that EQL on symbols is the
same as EQ, so EQ per se is unnecessary.  But isn't it preferable to retain EQ
so that the compiler can generate the very fast inline operation for EQ instead
of (possibly, depending on the implementation) having to invoke an out-of-line
routine or a longer sequence of inline code to compare two things using EQL?
If neither operand is a constant or a type-declared variable or function call,
it is not known whether the EQL call may be optimized into an EQ call.  (This
is probably not a problem for your implementation, JonL, or for many others',
but it may be for others - it is for mine.)