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

# 18  Predicate Functions

1. atom - is this an atom ?
2. symbolp - is this a symbol ?
3. numberp - is this a number ?
4. null - is this an empty list ?
5. not - is this false ?
6. listp - is this a list ?
7. endp - is this the end of a list ?
8. consp - is this a non-empty list ?
9. integerp - is this an integer ?
10. floatp - is this a float ?
11. stringp - is this a string ?
12. characterp - is this a character ?
13. arrayp - is this an array ?
14. streamp - is this a stream ?
15. objectp - is this an object ?
16. boundp - is a value bound to this symbol ?
17. fboundp - is a functional value bound to this symbol ?
18. minusp - is this number negative ?
19. zerop - is this number zero ?
20. plusp - is this number positive ?
21. evenp - is this integer even ?
22. oddp - is this integer odd ?
23. eq - are the expressions identical ?
24. eql - are the expressions identical ?
25. equal - are the expressions equal ?

Note: The string predicate functions are described in Chapter 26, String Functions, the character predicate functions are described in Chapter 27, Character Functions.

(atom expr) - is this an atom ?
expr - the expression to check
returns - T if the value is an atom, NIL otherwise

(symbolp expr) - is this a symbol ?
expr - the expression to check
returns - T if the expression is a symbol, NIL otherwise

(numberp expr) - is this a number ?
expr - the expression to check
returns - T if the expression is a number, NIL otherwise

(null expr) - is this an empty list ?
expr - the list to check
returns - T if the list is empty, NIL otherwise

(not expr) - is this false ?
expr - the expression to check
return - T if the value is NIL, NIL otherwise

(listp expr) - is this a list ?
expr - the expression to check
returns - T if the value is a cons or NIL, NIL otherwise

(endp list) - is this the end of a list ?
list - the list
returns - T if the value is NIL, NIL otherwise

(consp expr) - is this a non-empty list ?
expr - the expression to check
returns - T if the value is a cons, NIL otherwise

(integerp expr) - is this an integer ?
expr - the expression to check
returns - T if the value is an integer, NIL otherwise

(floatp expr) - is this a float ?
expr - the expression to check
returns - T if the value is a float, NIL otherwise

(stringp expr) - is this a string ?
expr - the expression to check
returns - T if the value is a string, NIL otherwise

(characterp expr) - is this a character ?
expr - the expression to check
returns - T if the value is a character, NIL otherwise

(arrayp expr) - is this an array ?
expr - the expression to check
returns - T if the value is an array, NIL otherwise<

(streamp expr) - is this a stream ?
expr - the expression to check
returns - T if the value is a stream, NIL otherwise

(objectp expr) - is this an object ?
expr - the expression to check
returns - T if the value is an object, NIL otherwise

(boundp sym) - is a value bound to this symbol ?
sym - the symbol
returns - T if a value is bound to the symbol, NIL otherwise

(fboundp sym) - is a functional value bound to this symbol ?
sym - the symbol
returns - T if a functional value is bound to the symbol, NIL otherwise

(minusp expr) - is this number negative ?
expr - the number to test
returns - T if the number is negative, NIL otherwise

(zerop expr) - is this number zero ?
expr - the number to test
returns - T if the number is zero, NIL otherwise

(plusp expr) - is this number positive ?
expr - the number to test
returns - T if the number is positive, NIL otherwise

(evenp expr) - is this integer even ?
expr - the integer to test
returns - T if the integer is even, NIL otherwise

(oddp expr) - is this integer odd ?
expr - the integer to test
returns - T if the integer is odd, NIL otherwise

(eq expr1 expr2) - are the expressions identical ?
expr1 - the first expression
expr2 - the second expression
returns - T if they are equal, NIL otherwise

(eql expr1 expr2) - are the expressions identical ? (works with all numbers)
expr1 - the first expression
expr2 - the second expression
returns - T if they are equal, NIL otherwise

(equal expr1 expr2) - are the expressions equal ?
expr1 - the first expression
expr2 - the second expression
returns - T if they are equal, T otherwise

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