Table of Contents
The logic! datatype represents the boolean values true and false.
Logic! is a member of the following typesets: immediate!
Logic values can be created using literal syntax, or at runtime using a make constructor, or a to conversion.
to logic! converts to true for any value except for false and none.
>> to logic! 'hi
== true
>> to logic! 1
== true
>> to logic! 0
== true
>> to logic! none
== false
>> to logic! false
== false|
Note
|
For boolean logic support, true and false values can be constructed from 1 and 0 using make.
|
>> make logic! 1
== true
>> make logic! 0
== false
>> make integer! true
== 1
>> make integer! false
== 0Use logic? to check if a value is of the logic! datatype.
>> logic? on
== trueUse type? to return the datatype of a given value.
>> type? false
== logic!