NAME ^

classes/perlstring.pmc - Perl String

DESCRIPTION ^

PerlString extends String to provide Perl-specific string behaviour. Note that the morph and set_pmc methods come from PerlScalar, not from String.

Methods ^

STRING *get_repr()

Returns pythons string repr (w/o any escaping, just single quotes around)

void set_integer_native(INTVAL value)

Morphs the string to a PerlInt and sets its value to value.

void set_number_native(FLOATVAL value)

Morphs the string to a PerlNum and sets its value to value.

void set_pmc(PMC *value)

Sets the value of the PMC to the value in *value.

void morph(INTVAL type)

Morphs the PerlString to the specified type.

void add(PMC *value, PMC *dest)

Adds *value to the string and returns the result in *dest.

void subtract(PMC *value, PMC *dest)

Subtracts *value from the string and returns the result in *dest.

void multiply(PMC *value, PMC *dest)

Multiplies the string by *value and returns the result in *dest.

void divide(PMC *value, PMC *dest)

Divides the string by *value and returns the result in *dest.

void modulus(PMC *value, PMC *dest)

Calculates the string mod *value and returns the result in *dest.

When Python mode is enabled does sprintf :(

void increment()

void decrement()

These two methods are partially implemented. They should provide Perl 5 like string increment/decrement.

PMC *get_pmc_keyed(PMC *key)

Returns the string value for SELF[key].


parrot