Predicates

Typep and subtypep of Common Lisp are not provided, and should be simulated by subclassp and derivedp.



eq obj1 obj2 [function]

returns T, if obj1 and obj2 are pointers to the same object, or the same numbers. Examples: (eq 'a 'a) is T, (eq 1 1) is T, (eq 1. 1.0) is nil, (eq "a" "a") is nil.


eql obj1 obj2 [function]
Eq and eql are identical since all the numbers in EusLisp are represented as immediate values.


equal obj1 obj2 [function]
Checks the equality of any structured objects, such as strings, vectors or matrices, as long as they do not have recursive references. If there is recursive reference in obj1 or obj2, equal loops infinitely.


superequal obj1 obj2 [function]
Slow but robust equal, since superequal checks circular reference.


null object [function]

T if object is nil. Equivalent to (eq object nil).


not object [function]
not is identical to null.


atom object [function]
returns NIL only if object is a cons. (atom nil) = (atom '()) = T). Note that atom returns T for vectors, strings, read-table, hash-table, etc., no matter what complex objects they are.


every pred &rest args [function]
returns T if all args return T for pred. Every is used to test whether pred holds for every args.


some pred &rest args [function]
returns T if at least one of args return T for pred. Some is used to test whether pred holds for any of args.


functionp object [function]
T if object is a function object that can be given to apply and funcall. Note that macros cannot be apply'ed or funcall'ed. Functionp returns T, if object is either a compiled-code with type=0, a symbol that has function definition, a lambda-form, or a lambda-closure. Examples: (functionp 'car) = T, (functionp 'do) = NIL


compiled-function-p object [function]
T if object is an instance of compiled-code. In order to know the compiled-code is a function or a macro, send :type message to the object, and function or macro is returned.


k-okada 2013-05-21