GNU Info

Info Node: (librep.info)Equality Predicates

(librep.info)Equality Predicates


Next: Comparison Predicates Prev: Printed Representation Up: Data Types
Enter node , (file) or (file)node

Equality Predicates
-------------------

 - Function: eq arg1 arg2
     Returns true when ARG1 and ARG2 refer to the same object.  Two
     objects are the same when they occupy the same place in memory and
     hence modifying one object would alter the other. The following
     Lisp fragments may illustrate this,

          (eq "foo" "foo")        ;the objects are distinct
              => ()
          
          (eq t t)                ;the same object -- the symbol `t'
              => t

     Note that the result of `eq' is undefined when called on two
     integer objects with the same value, see `eql'.

 - Function: equal arg1 arg2
     The function `equal' compares the structure of the two objects
     ARG1 and ARG2. If they are considered to be equivalent then
     returns true, otherwise returns false.

          (equal "foo" "foo")
              => t
          
          (equal 42 42)
              => t
          
          (equal 42 0)
              => ()
          
          (equal '(x . y) '(x . y))
              => t

 - Function: eql arg1 arg2
     This function is a cross between `eq' and `equal': if ARG1 and
     ARG2 are both numbers then the value of these numbers are
     compared. Otherwise it behaves in exactly the same manner as `eq'
     does.

          (eql 3 3)
              => t
          
          (eql 1 2)
              => ()
          
          (eql "foo" "foo")
              => ()
          
          (eql 'x 'x)
              => t


automatically generated by info2www version 1.2.2.9