NAME
src/pmc/boolean.pmc - Boolean PMC
DESCRIPTION
This PMC implements a Boolean type with a single true/false value.
A Boolean does not morph to other types when its value is set; it simply changes its value.
This implementation of Boolean inherits from the Scalar PMC.
Unlike the previous implementation,
it does not inherit from Integer.
Functions
void init()
Create a new void init_pmc(PMC *value)
Create a new void init_int(INTVAL value)
Create a new INTVAL get_bool()
Obtain the value of the INTVAL get_integer()
Same as FLOATVAL get_number()
Obtain the value of the STRING *get_string()
Obtain the value of the void set_bool(INTVAL value)
Sets the value of the Boolean to the specified integer value: 0 = void set_integer_native(INTVAL value)
Same as void set_number_native(FLOATVAL value)
Sets the value of the Boolean to the specified float value: 0.0 = void set_string_native(STRING *value)
Sets the Boolean to the value represented by the specified string.
All values are considered INTVAL is_equal(PMC *value)
The void freeze(PMC *info)
Used to archive the void thaw(PMC *info)
Used to unarchive the
Boolean with initial value FALSE.
Boolean with the given initial value interpreted as a Boolean.
Boolean with the given initial value interpreted as a Boolean.
Boolean as an integer: 1 = TRUE,
0 = FALSE.
get_bool().
Boolean as a float: 1.0 = TRUE,
0.0 = FALSE.
Boolean as a string: "1" = TRUE,
"0" = FALSE.
FALSE,
non-0 = TRUE.
set_bool().
FALSE,
non-0.0 = TRUE.
TRUE except for "" and "0",
which are considered FALSE.
== operation.
Boolean.
Boolean.See also the Scalar PMC.