NAME ^

classes/intlist.pmc - Array of integers

DESCRIPTION ^

IntList provides an integer-only array.

Methods ^

PMC *clone()

Creates and returns a clone of the list.

void init()

Initializes the list.

void mark()

Marks the list as live.

void set_integer_keyed_int(INTVAL key, INTVAL value)

Sets value at index key.

void set_integer_keyed (PMC *key, INTVAL value)

Sets value at index *key.

INTVAL get_integer()

Returns the number of elements in the list.

INTVAL get_integer_keyed_int(INTVAL key)

Returns the value of the element at index key.

INTVAL get_integer_keyed(PMC *key)

Returns the value of the element at index *key.

void push_integer(INTVAL value)

Adds value to the end of the list.

INTVAL pop_integer()

Removes and returns the last element in the list.

void unshift_integer(INTVAL value)

Adds value to the start of the list.

INTVAL shift_integer()

Removes and returns the first element in the list.

void multiply_int(INTVAL value, PMC *dest)

Python (b6.main):

 # L = [1] * 1000000

  4           0 LOAD_CONST               1 (1)
              3 BUILD_LIST               1
              6 LOAD_CONST               2 (1000000)
              9 BINARY_MULTIPLY
             10 STORE_FAST               2 (L)
Build a list by duplicating the passed list N times. Only implemented for list.elements == 1.


parrot