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

eql


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

Syntax

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

Description

The 'eql' predicate function checks to see if 'expr1' and 'expr2' are identical [in the eq test sense, the expression values being the same exact internal values] or if they have the same value when the expressions are numbers.  T  is returned if they are identical or have the same numeric value, NIL is returned otherwise.

Examples

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

See the eql predicate function in the XLISP 2.0 manual.

  Back to Top


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