Of all the standard values, only #f
counts as false in conditional expressions.
Except for #f,
all standard values, including #t,
pairs, the empty list, symbols, numbers, strings, and procedures,
count as true.
| Programmers accustomed to other dialects of Lisp should be aware that
the expression language distinguishes both #f and the empty list from the symbol
nil. |
|
Boolean constants evaluate to themselves, so they don't need to be quoted
in expressions.
#t #t
#f #f
'#f #f
8.5.1.1 Negation
(not obj)
not returns #t if obj is false, and returns
#f otherwise.
(not #t) #f
(not 3) #f
(not (list 3)) #f
(not #f) #t
(not '()) #f
(not (list)) #f
(not 'nil) #f
8.5.1.2 Boolean Type Predicate
(boolean? obj)
boolean? returns #t if obj is either #t or
#f and returns #f otherwise.
(boolean? #f) #t
(boolean? 0) #f
(boolean? '()) #f