National Institute of Advanced Industrial Science and Technology (AIST) This page is a page of the former research institute. We stopped updating on March 31.2001.
E-mail to webmaster (Japanese) E-mail to webmaster (English)
next up previous contents index
Next: Object Oriented Programming Up: Control Structures Previous: Iteration

Predicates

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

  eq obj1 obj2 [function]

  eql obj1 obj2 [function]   equal obj1 obj2 [function]   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.


next up previous contents index
Next: Object Oriented Programming Up: Control Structures Previous: Iteration

Hirofumi Nakagaki
Fri Mar 22 12:46:38 JST 1996