On this page:
bit?
bit->boolean
boolean->bit
8.12

6.1 Bits🔗ℹ

 (require rebellion/binary/bit) package: rebellion

A bit is either zero or one. Eight bits form a byte, and a bitstring is an arbitrary-length sequence of bits.

procedure

(bit? v)  boolean?

  v : any/c
A predicate for bits.

procedure

(bit->boolean b)  boolean?

  b : bit?
Converts zero to false and one to true.

Examples:
> (bit->boolean 0)

#f

> (bit->boolean 1)

#t

procedure

(boolean->bit bool)  bit?

  bool : boolean?
Converts true to one and false to zero.

Examples:
> (boolean->bit #true)

1

> (boolean->bit #false)

0