NAME ^

src/pmc/undef.pmc - Generic undefined value

DESCRIPTION ^

This is Parrot's generic undef type. This PMC has no defined value. It returns a numeric value of 0, a boolean of false, and an empty string. When assigned a number, integer, or string it morphs to a Number, Integer, or String PMC respectively, and when assigned a generic PMC it morphs into a PMC of the passed-in type and does a same-type assignment from there.

Methods ^

void set_pmc(PMC *other)

Sets the current PMC to *other by first changing the current PMC to the appropriate type.

void assign_pmc(PMC *other)

Assigns the PMC to the value of *other by first changing the PMC to the appropriate type.

INTVAL get_integer()

Returns 0.

INTVAL defined()

Returns 0.

void set_integer_native(INTVAL value)

Morphs the current PMC to an Integer and sets the value from value.

FLOATVAL get_number()

Returns 0.0.

void set_number_native(FLOATVAL value)

Morphs the current PMC to a Float and sets the value from value.

STRING *get_string()

Returns an empty string.

void set_string_native(STRING *value)

Morphs the current PMC to a String and sets the value from value.

INTVAL get_bool()

Returns 0.

void share()

Unknown. (TODO)

PMC *share_ro()

Unknown. (TODO)

PMC *clone()

Clones the current Undef PMC.

INTVAL is_equal(PMC *value)

Returns 1 if the *value is an Undef PMC, 0 otherwise.


parrot