Next: , Previous: , Up: baselib   [Index]


4.7 Booleans

The standard boolean objects for true and false have external representations #t and #f. However, of all objects, only #f counts as false in conditional expressions.

NOTE Programmers accustomed to other dialects of Lisp should be aware that Scheme distinguishes both #f and the empty list from each other and from the symbol nil.

Procedure: not obj

Return #t if obj is #f, or #f otherwise.

(not #t)         ⇒ #f
(not 3)          ⇒ #f
(not (list 3))   ⇒ #f
(not #f)         ⇒ #t
(not '())        ⇒ #f
(not (list))     ⇒ #f
(not 'nil)       ⇒ #f
Procedure: boolean? obj

Return #t if obj is either #t or #f, or #f otherwise.

(boolean? #f)   ⇒ #t
(boolean? 0)    ⇒ #f
(boolean? '())  ⇒ #f
Procedure: boolean=? bool1 bool2 bool3

Return #t if the booleans are the same.