Structural Informatics Group (SIG) logo
Home | Projects | Demos | Downloads | Publications | Local Info | About Us | New site
Go to the first, previous, next, last section, table of contents.

equal

equal

type: predicate function (subr)
location: built-in
source file: xllist.c and xlsubr.c
Common LISP compatible: yes
supported on: all machines

SYNTAX

(equal <expr1> <expr2> )
        <exprN>         -       an expression to compare

DESCRIPTION

The EQUAL predicate checks to see if <expr1> and <expr2> are structurally equivalent. T is returned if they are equivalent, NIL is returned otherwise.

EXAMPLES

(equal 'a 'a)                           ; returns T
(equal 1 1)                             ; returns T
(equal 1 1.0)                           ; returns NIL
(equal 1.0 1.0)                         ; returns T
(equal "a" "a")                         ; returns T
(equal '(a b) '(a b))                   ; returns T
(equal 'a 34)                           ; returns NIL
(setq a '(a b))                         ; set value of A to (A B)
(setq b a)                              ; set B to point to A's value
(setq c '(a b))                         ; set value of C to dif. (A B)
(equal a b)                             ; returns T
(equal a c)                             ; returns T
(equal '(a b) '(A B))                   ; returns T
(equal '(a b) '(c d))                   ; returns NIL
(equal "a" "A")                         ; returns NIL
(equal "abc" "abcD")                    ; returns NIL

NOTE: A way to view EQUAL is that if <expr1> and <expr2> were printed (via PRINT or PRINC), if they look the same, then EQUAL will return T.


Go to the first, previous, next, last section, table of contents.