1.15 class bool

Class bool defines represents PCE's two boolean constants: @on and @off. These objects are protected (see object->protect). No other boolean constants can be created.

See also
class constant
To be done
Methods for logical expressions are still lacking.

1.15.1 Send methods

bool ->initialise:
Generates the error !cannot_create_instances.
bool ->unlink:
The two instances of class bool cannot be unlinked as they are object->protect’ed.

1.15.2 Get methods

bool <-convert: any -> bool
The following values are converted to booleans:
0@off
any other integer@on
@on@on
@off@off
true, yes, constant<-name @on
false, no, constant<-name @off
bool <-negate: -> bool
Maps @on to @off and visa versa. The recogniser object below will toggle the graphical->inverted:
?- new(@toggle_inverted,
       click_gesture(left, '', single,
                     message(@receiver, inverted,
                             @receiver?inverted?negate))).