Booleans is another RainLisp's basic data type. A boolean is either true
or false
.
Let's evaluate some boolean literals.
true
-> true
false
-> false
There is a primitive procedure not
that returns the logical negation of the argument.
(not true)
-> false
(not false)
-> true
Note that in RainLisp, in conditional expressions like
if
,cond
and others likenot
,and
,or
that expect booleans, all values other than false are considered to be true. For example,(not 0)
and(not 1)
both givefalse
.
The boolean logical operations are:
Next, let's learn about strings.