Jump to content

Parrot Virtual Machine/VTABLE List

From Wikibooks, open books for an open world

Vtable List

[edit | edit source]
Vtable name Description
absolute Returns the absolute value of the PMC, as a PMC
add_attribute Adds an attribute to the PMC object. Attributes are typically stored in the pmc->pmc_ext->_metadata field.
add_method Adds a new method to the PMC's class
add_parent
add_role
add_vtable_override
assign_pmc Assigns a PMC value to the PMC
assign_string_native Assigns a string to the PMC
bitwise_not
bitwise_nots
can
clone
clone_pmc
decrement Decrements the integer value of the PMC by 1
defined Determines if the PMC is defined
defined_keyed
defined_keyed_int
defined_keyed_str
delprop Deletes a property from the PMC
destroy Destroy the PMC
does
does_pmc
elements
exists_keyed
exists_keyed_int
exists_keyed_str
find_method
freeze
get_attr
get_bignum Gets the BigNum representation of the PMC
get_bool Gets the boolean representation of the PMC
get_class
get_integer Gets the integer representation of the PMC
get_integer_keyed
get_integer_keyed_int
get_integer_keyed_str
get_iter
get_namespace
get_number Gets the floating-point representation of the PMC
get_number_keyed
get_number_keyed_int
get_number_keyed_str
get_pmc Gets the PMC representation of the PMC
get_pmc_keyed
get_pmc_keyed_int
get_pmc_keyed_str
get_pointer
get_pointer_keyed
get_pointer_keyed_int
get_pointer_keyed_str
get_repr
get_string Gets the string representation of the PMC
get_string_keyed
get_string_keyed_int
get_string_keyed_srt
getprop Get the value of a certain property from the PMC
getprops
i_absolute
i_bitwise_not
i_bitwise_nots
i_logical_not
i_net
increment Increments the integer value of the PMC by 1
init Initializes the PMC. This method is called when the new keyword is used to create a new PMC.
init_pmc
inspect
inspect_str
instantiate
invoke The invoke vtable method is called when the PMC is called like a function. In the following code:
.local pmc mypmc = new 'MyPMCType'
mypmc()

The invoke vtable method is called on the second line when the PMC is treated as a function call. For string functions, for example, the string class uses the value of the string to look up a function with the same name, and then invokes that function. Subroutine PMCs invoke the given function when they are called.

is_same
isa
isa_pmc
logical_not
mark Mark the PMC and all its children as alive for the memory manager. This prevents children of the PMC from being collected prematurely by the garbage collector.
morph
name
neg
new_from_string
nextkey_keyed
nextkey_keyed_int
nextkey_keyed_str
pop_float If the PMC is an array, pops a floating point value off the top of it
pop_integer If the PMC is an array, pops an integer value off the top of it
pop_pmc If the PMC is an array, pops a PMC value off the top of it
pop_string If the PMC is an array, pops a string value off the top of it
push_float If the PMC is an array, pushes a floating point value onto the top of it
push_integer If the PMC is an array, pushes an integer onto the top of it
push_pmc If the PMC is an array, pushes a PMC onto the top of it
push_string If the PMC is an array, pushes a string onto the top of it
remove_attribute Removes an attribute from the PMC
remove_method
remove_parent
remove_role
remove_vtable_override
set_attr Sets an attribute value for the given PMC
set_attr_keyed
set_attr_keyed_str
set_bugnum_int
set_bignum_num
set_bignum_str
set_bool Sets the value of the PMC as if it were a boolean
set_integer_keyed
set_integer_keyed_int
set_integer_keyed_str
set_integer_native Sets the value of the PMC as if it were an integer
set_number_keyed
set_number_keyed_int
set_number_keyed_str
set_number_native Sets the value of the PMC as if it were a floating point value
set_number_same
set_pmc Sets the value of a PMC to the value of another PMC
set_pmc_keyed
set_pmc_keyed_int
set_pmc_keyed_str
set_pointer
set_pointer_keyed
set_pointer_keyed_int
set_pointer_keyed_str
set_string_keyed
set_string_keyed_int
set_string_keyed_str
set_string_native Sets the value of the PMC as if it were a string
set_string_same
setprop
share
share_ro
shift_float If the PMC is an array, shifts a floating point value onto the bottom of it
shift_int If the PMC is an array, shifts an integer onto the bottom of it
shift_pmc If the PMC is an array, shifts a PMC onto the bottom of it
shift_string If the PMC is an array, shifts a string onto the bottom of it
slice
splice
substr
substr_str
thaw
thawfinish
type
type_keyed
type_keyed_int
type_keyed_str
unshift_float If the PMC is an array, unshifts a floating point valuefrom the bottom of it
unshift_integer If the PMC is an array, unshifts an integer from the bottom of it
unshift_pmc If the PMC is an array, unshifts a PMC from the bottom of it
unshift_str If the PMC is an array, unshifts a string from the bottom of it
visit