NAME
src/pmc/pmclist.pmc - List of PMCs
DESCRIPTION
A doubly linked list of PMCs, for when push, pop, shift, and unshift all want to be O(1).
Vtable Functions
void init()
Initializes the list.
void destroy()
Free all the list cells.
INTVAL get_integer()
Returns the size of the list.
PMC *shift_pmc()
Removes and returns an item from the start of the array.
void push_pmc(PMC *value)
Extends the array by adding an element of value PMC *pop_pmc()
Removes and returns the last element in the array.
void unshift_pmc(PMC *value)
Extends the array by adding an element of value PMC *clone()
Creates and returns a copy of the list.
STRING *get_repr()
Returns the Parrot string representation void visit(PMC *info)
This is used by freeze/thaw to visit the contents of the array.void freeze(PMC *info)
Used to archive the array.
void thaw(PMC *info)
Used to unarchive the array.
void mark()
Mark the stuff.
- METHOD PMC* shift()
- METHOD PMC* pop() Method forms to remove and return a PMC from the beginning or end of the array.
- METHOD unshift(PMC* value)
- METHOD push(PMC* value) Method forms to add a PMC to the beginning or end of the array.
- METHOD insert_by_number(PMC* value) Inserts an item into an ordered list by it's number value.
*value
to the end of the array.
*value
to the begin of the array.
ResizablePMCArray
.
*info
is the visit info,
(see include/parrot/pmc_freeze.h).
Auxiliary functions
void Parrot_pmc_list_insert_by_number(PARROT_INTERP, PMC *list, PMC *value)
Insert an item into a sorted list by its num value.
static void throw_shift_empty(PARROT_INTERP)
static void throw_pop_empty(PARROT_INTERP)
Throws with the appropiate message.
See also
docs/pdds/pdd17_basic_types.pod.