Previous: , Up: Common List Functions   [Contents][Index]


7.2.1.5 Non-List functions

Function: and? arg1 …

and? checks to see if all its arguments are true. If they are, and? returns #t, otherwise, #f. (In contrast to and, this is a function, so all arguments are always evaluated and in an unspecified order.)

Example:

(and? 1 2 3)
   ⇒ #t
(and #f 1 2)
   ⇒ #f
Function: or? arg1 …

or? checks to see if any of its arguments are true. If any is true, or? returns #t, and #f otherwise. (To or as and? is to and.)

Example:

(or? 1 2 #f)
   ⇒ #t
(or? #f #f #f)
   ⇒ #f
Function: atom? object

Returns #t if object is not a pair and #f if it is pair. (Called atom in Common LISP.)

(atom? 1)
   ⇒ #t
(atom? '(1 2))
   ⇒ #f
(atom? #(1 2))   ; dubious!
   ⇒ #t