8.14.0.2
3.3 Bool
(require cur/stdlib/bool) | package: cur-lib |
This library defines the datatype Bool and several functions and forms for using them.
The boolean datatype.
syntax
(if test-expr c-expr alt-expr)
A syntactic form that expands to the inductive eliminator for Bool. This form is currently non-dependent— the branches do not know that test-expr is equal to true or false.
Examples:
Negates the boolean x.
Examples:
Examples:
Examples:
procedure
(bool->meta-bool syn) → boolean?
syn : syntax?
A meta-procedure, provided at phase 1, that converts syntax representing a
Bool literal into a Racket (meta-level) boolean?.
Example:
> (begin-for-syntax (displayln (bool->meta-bool #'true))) #t
procedure
(meta-bool->bool b) → syntax?
b : boolean?
A meta-procedure, provided at phase 1, that converts a Racket (meta-level)
boolean? into syntax representing a Bool.
Example:
> (begin-for-syntax (displayln (meta-bool->bool #f))) #<syntax:/home/root/user/.local/share/racket/snapshot/pkgs/cur-lib/cur/stdlib/bool.rkt:44:19 false>