Skip to content

Booleans

Amitai Erfanian edited this page Oct 23, 2020 · 10 revisions

Boolean Methods

And

(and expression expression expression ...) -> boolean

Evaluates to #true if all the expressions are #true. If any expression is #false, the and expression evaluates to #false (and the expressions to the right of that expression are not evaluated.) If any of the expressions evaluate to a value other than #true or #false, and reports an error.

Equal

(boolean=? [boolean] [boolean]) -> boolean

Negates a boolean value.

(boolean=? #true #false)
#false


Is Boolean

(boolean? [any]) -> boolean

Determines whether some value is a boolean.

(boolean? 42)
#false


Is False

(false? [any]) -> boolean

Determines whether some value is a boolean.

(false? #true)
#false


Not

(not [boolean]) -> boolean

Negates a boolean value.

(not #false)
#true


Or

(or expression expression expression ...) -> boolean

Evaluates to #true as soon as one of the expressions is #true (and the expressions to the right of that expression are not evaluated.) If all of the expressions are #false, the or expression evaluates to #false. If any of the expressions evaluate to a value other than #true or #false, or reports an error.


Boolean Conversions

Boolean To Integer

(boolean->integer [boolean]) -> integer

Produces an integer for the given boolean.

(boolean->integer #true)
1


Boolean To String

(boolean->string [boolean]) -> string

Produces a string for the given boolean.

(boolean->string #true)
"true"


Clone this wiki locally