NAME ^

pmc/pylist.pmc - Python List

DESCRIPTION ^

These are the vtable functions for the PyList base class

Methods ^

void init()

Initializes the PMC by calling the underlying list_new() function.

PMC* "__new__"(PMC *class, PMC *source)

Create a new list.

PMC* "__getitem__"(PMC *self, PMC *idx)

Returns the PMC value of the element at index key.

PMC* "__setitem__"(PMC *self, PMC *idx, PMC *value)

Sets the PMC at element idx to *value.

PMC *add(PMC *value, PMC *dest)

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

void "append" (PMC *self, PMC *value)

Extends the array by adding an element of value *value to the end of the array.

void mark()

Mark the array and its contents as live.

void delete_keyed(PMC *key)

Delete a (range of) elements from the list

INTVAL elements()

Returns the number of elements in the array.

INTVAL get_bool()

Returns true iff there are elements in the list.

PMC *get_class()

Return the class of this object.

INTVAL get_integer()

Returns the number of elements in the array.

PMC *get_iter ()

Return a new iterator for SELF.

PMC *get_pmc_keyed(PMC *key)

Returns the PMC value of the element at index key.

PMC *get_pmc_keyed_int(INTVAL key)

Returns the PMC value of the element at index key.

STRING *get_string()

Returns the list as a string

STRING *get_string_keyed(PMC *key)

Returns the PMC value of the element at index key as a string.

INTVAL is_equal (PMC *value)

The == operation. Compares two array to hold equal elements.

PMC *multiply_int(INTVAL value, PMC *dest)

Build a list by duplicating the passed list N times.

void push_integer (INTVAL value)

Extends the array by adding an element of value value to the end of the array.

void push_pmc (PMC *value)

Extends the array by adding an element of value *value to the end of the array.

void push_string (STRING *value)

Extends the array by adding an element of value *value to the end of the array.

void set_integer_keyed_int (INTVAL key, INTVAL value)

Sets the integer value of the PMC at element key to value.

void set_integer_native(INTVAL size)

Sets the length of the array to size.

void set_pmc_keyed(PMC *key)

Sets the PMC at element key to *value.

void set_pmc_keyed_int(INTVAL key, PMC *src)

Assigns *src to the array at index key.

void set_string_keyed_int(INTVAL key, STRING *value)

Sets the string value of the PMC at element key to value.

void* "sort"(PMC *cmp_func)

Sort this array, optionally using the provided cmp_func


parrot