parrotcode: Scalar Abstract Superclass | |
Contents | PMCs |
classes/scalar.pmc - Scalar Abstract Superclass
These are the vtable functions for the scalar base PMC class
void morph(INTVAL type)
void assign_pmc(PMC *value)
*value
,
calling the appropriate set_*
method according to the type of *value
.PMC *clone()
/*
PMC *subtract(PMC *value, PMC *dest)
void add(PMC *value, PMC *dest)
void add_int(INTVAL value, PMC *dest)
void add_float(FLOATVAL value, PMC *dest)
Adds
value
to the number and returns the result in*dest
. Ifdest
is NULL it's created.
void i_add(PMC *value)
void i_add(INTVAL value)
void i_add(FLOATVAL value)
Adds
value
toSELF
inplace.
PMC *subtract(PMC *value, PMC *dest)
PMC *subtract_int(INTVAL value, PMC *dest)
PMC *subtract_float(FLOATVAL value, PMC *dest)
Subtracts
value
from the number and returns the result in*dest
. Ifdest
doesn't exist a newFloat
is created.
void i_subtract(PMC *value)
void i_subtract_int(INTVAL value)
void i_subtract_float(FLOATVAL value)
Subtracts
value
fromSELF
inplace.
PMC *multiply(PMC *value, PMC *dest)
PMC *multiply_int(INTVAL value, PMC *dest)
PMC *multiply_float(FLOATVAL value, PMC *dest)
Multiplies the number by
value
and returns the result in*dest
.
PMC *divide(PMC *value, PMC *dest)
PMC *divide_int(INTVAL value, PMC *dest)
PMC *divide_float(FLOATVAL value, PMC *dest)
Divides the number by
value
and returns the result in*dest
.
void i_divide(PMC *value)
void i_divide_int(INTVAL value)
void i_divide_float(FLOATVAL value)
Divides
SELF
byvalue
inplace.
PMC *floor_divide(PMC *value, PMC *dest)
PMC *floor_divide_int(INTVAL value, PMC *dest)
PMC *floor_divide_float(FLOATVAL value, PMC *dest)
Divides the number by
value
and returns the result in*dest
.
void i_floor_divide(PMC *value)
void i_floor_divide_int(INTVAL value)
void i_floor_divide_float(FLOATVAL value)
Divides
SELF
byvalue
inplace.
PMC *cmodulus(PMC *value, PMC *dest)
PMC *cmodulus(INTVAL value, PMC *dest)
PMC *cmodulus(FLOATVAL value, PMC *dest)
Calculates the value of the number C-style
mod
value
and returns the result indest
.
void i_cmodulus(PMC *value)
void i_cmodulus(INTVAL value)
void i_cmodulus(FLOATVAL value)
Calculates the value of the number C-style
mod
value
and returns the result indest
.
PMC *modulus(PMC *value, PMC *dest)
PMC *modulus(INTVAL value, PMC *dest)
PMC *modulus(FLOATVAL value, PMC *dest)
Calculates the value of corrected
mod
value
and returns the result indest
. See also ops/math.ops.
void i_modulus(PMC *value)
void i_modulus(INTVAL value)
void i_modulus(FLOATVAL value)
Calculates modulus inplace
PMC *pow(PMC *value, PMC *dest)
PMC *pow_int(INTVAL value, PMC *dest)
PMC *pow_float(FLOATVAL value, PMC *dest)
Calculates
SELF pow value
and returns the result indest
. See also ops/math.ops.
void i_pow(PMC *value)
void i_pow_int(INTVAL value)
void i_pow_float(FLOATVAL value)
Calculates pow inplace
PMC *neg(PMC *dest)
void i_neg()
Set
dest
to the negated value ofSELF
.
PMC *bitwise_or(PMC *value, PMC *dest)
PMC *bitwise_or_int(INTVAL value, PMC *dest)
*dest
the bitwise OR
of the scalar and value
.void i_bitwise_or(PMC *value)
void i_bitwise_or_int(INTVAL value)
PMC *bitwise_and(PMC *value, PMC *dest)
PMC *bitwise_and_int(INTVAL value, PMC *dest)
*dest
the bitwise AND
of the scalar and value
.void i_bitwise_and(PMC *value)
void i_bitwise_and_int(INTVAL value)
void bitwise_xor(PMC *value, PMC *dest)
void bitwise_xor_int(INTVAL value, PMC *dest)
*dest
the bitwise XOR
of the scalar and *value
.void i_bitwise_xor(PMC *value)
void i_bitwise_xor_int(INTVAL value)
PMC *bitwise_not(PMC *dest)
void i_bitwise_not()
*dest
the bitwise negation of the scalar and value
.PMC *bitwise_shr(PMC *value, PMC *dest)
PMC *bitwise_shr_int(INTVAL value, PMC *dest)
*dest
the arithmetic shift right of the scalar by value
.void i_bitwise_shr(PMC *value)
void i_bitwise_shr_int(INTVAL value)
PMC *bitwise_lsr(PMC *value, PMC *dest)
PMC *bitwise_lsr_int(INTVAL value, PMC *dest)
*dest
the logical shift right of the scalar by *value
.void i_bitwise_lsr(PMC *value)
void i_bitwise_lsr_int(INTVAL value)
PMC *bitwise_shl(PMC *value, PMC *dest)
PMC *bitwise_shl_int(INTVAL value, PMC *dest)
*dest
the shift left of the scalar by *value
.void i_bitwise_shl(PMC *value)
void i_bitwise_shl_int(INTVAL value)
PMC *concatenate(PMC *value, PMC *dest)
PMC *concatenate_str(STRING *value, PMC *dest)
*dest
the result of concatenating the scalar and *value
.void concatenate(PMC *value)
void concatenate_str(STRING *value)
value
in place.PMC *repeat(PMC *value, PMC *dest)
PMC *repeat_int(INTVAL value, PMC *dest)
*dest
the result of repeating the scalar value
times.void i_repeat(PMC *value)
void i_repeat_int(INTVAL value)
SELF
in place value
times.INTVAL cmp_num(PMC *value)
*value
.INTVAL cmp_string(PMC *value)
*value
.void logical_or(PMC *value, PMC *dest)
*dest
the result of the logical OR
of the scalar and *value
.void i_logical_or(PMC *value)
PMC *logical_and(PMC *value, PMC *dest)
*dest
the result of the logical AND
of the scalar and *value
. void i_logical_and(PMC *value)
PMC *logical_xor(PMC *value, PMC *dest)
*dest
the result of the logical XOR
of the scalar and *value
.void i_logical_xor(PMC *value)
PMC *logical_not(PMC *dest)
void i_logical_not()
*dest
the result of the logical negation of the scalar and *value
.INTVAL defined()
STRING *substr_str(INTVAL offset, INTVAL length)
length
of the scalar starting at offset
.Hey! The above document had some coding errors, which are explained below:
|