Next: , Up: built-in booleans   [Contents][Index]


6.6.1 Type of boolean values

Core Type: <boolean>
Parent Type: <top>

Type of the boolean values #t and #f.

Constructor on <boolean>: <boolean> type-constructor obj

Return #t if obj is true; otherwise return #f.

(new <boolean> #f)      ⇒ #f
(new <boolean> #t)      ⇒ #t
(new <boolean> 12)      ⇒ #t
Type predicate on <boolean>: <boolean> type-predicate obj

The type predicate is boolean?. Return #t if obj is #t or #f; otherwise return #f.

(is-a? #t <boolean>)    ⇒ #t
(is-a? #f <boolean>)    ⇒ #t
(is-a? 12 <boolean>)    ⇒ #f
Hash function on <boolean>: <non-negative-fixnum> hash-function bool

The hash function is boolean-hash.

(hash #f)       ⇒ 0
(hash #t)       ⇒ 1