y - an object.
generalized-boolean - a generalized boolean.
Otherwise the value of eql is false.
If an implementation supports positive and negative zeros as distinct values, then (eql 0.0 -0.0) returns false. Otherwise, when the syntax -0.0 is read it is interpreted as the value 0.0, and so (eql 0.0 -0.0) returns true.
(eql 'a 'b) false (eql 'a 'a) true (eql 3 3) true (eql 3 3.0) false (eql 3.0 3.0) true (eql #c(3 -4) #c(3 -4)) true (eql #c(3 -4.0) #c(3 -4)) false (eql (cons 'a 'b) (cons 'a 'c)) false (eql (cons 'a 'b) (cons 'a 'b)) false (eql '(a . b) '(a . b)) true ORfalse (progn (setq x (cons 'a 'b)) (eql x x)) true (progn (setq x '(a . b)) (eql x x)) true (eql #\A #\A) true (eql "Foo" "Foo") true ORfalse (eql "Foo" (copy-seq "Foo")) false (eql "FOO" "foo") false
Normally (eql 1.0s0 1.0d0) is false, under the assumption that 1.0s0 and 1.0d0 are of distinct data types. However, implementations that do not provide four distinct floating-point formats are permitted to "collapse" the four formats into some smaller number of them; in such an implementation (eql 1.0s0 1.0d0) might be true.
eql may not be true of two floats even when they represent the same value. = is used to compare mathematical values.
Two complex numbers are considered to be eql if their real parts are eql and their imaginary parts are eql. For example, (eql #C(4 5) #C(4 5)) is true and (eql #C(4 5) #C(4.0 5.0)) is false. Note that while (eql #C(5.0 0.0) 5.0) is false, (eql #C(5 0) 5) is true. In the case of (eql #C(5.0 0.0) 5.0) the two arguments are of different types, and so cannot satisfy eql. In the case of (eql #C(5 0) 5), #C(5 0) is not a complex number, but is automatically reduced to the integer 5.