XLISP > XLISP 2.0  -  Contents  -  Reference  -  Previous | Next

eq


Type:   -   predicate function (subr)
Source:   -   xllist.c, xlsubr.c

Syntax

(eq expr1 expr2)
expr1 - the first expression to compare
expr2 - the second expression to compare
returns -  T  if the expressions are the same internal value, NIL otherwise

Description

The 'eq' predicate function checks to see if 'expr1' and 'expr2' are identical.  T  is returned if they are exactly the same internal value, NIL is returned otherwise.

Examples

(eq 'a 'a)          ; returns T
(eq 1 1)            ; returns T
(eq 1 1.0)          ; returns NIL
(eq 1.0 1.0)        ; returns NIL
(eq "a" "a")        ; returns NIL
(eq '(a b) '(a b))  ; returns NIL
(eq '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)
(eq a b)            ; returns T
(eq a c)            ; returns NIL

See the eq predicate function in the XLISP 2.0 manual.

  Back to Top


XLISP > XLISP 2.0  -  Contents  -  Reference  -  Previous | Next