NAME ^

src/classes/List.pir - Perl 6 List class and related functions

Object Methods ^

clone() (vtable method)

Return a clone of this list. (Clones its elements also.)

get_string() (vtable method)

Return the elements of the list joined by spaces.

hash()

Return the List invocant as a Hash.

item()

Return the List invocant in scalar context (i.e., an Arrayref).

list()

Return the List as a list.

perl()

Returns a Perl representation of a List.

List methods ^

!flatten()

Flatten the invocant, as in list context. This doesn't necessarily make the list eager, it just brings any nested Lists to the top layer. It will likely change substantially when we have lazy lists.

elems()

Return the number of elements in the list.

first(...)

grep(...)

iterator()

Returns an iterator for the list.

join(SEPARATOR)

Returns a string comprised of all of the list, separated by the string SEPARATOR. Given an empty list, join returns the empty string.

keys()

Returns a List containing the keys of the invocant.

kv()

Return items in invocant as 2-element (index, value) lists.

map()

Map.

pairs()

Return a list of Pair(index, value) elements for the invocant.

reduce(...)

reverse()

Returns a list of the elements in reverse order.

sort()

Sort list by copying into FPA, sorting and creating new List.

uniq(...)

values()

Returns a List containing the values of the invocant.

min()

Return minimum element in list

max()

Return maximum element in list

Functions ^

list(...)

Build a List from its arguments.

infix:,(...)

Operator form for building a list from its arguments.

infix:Z(...)

The zip operator.

infix:X(...)

The non-hyper cross operator.

infix:min(...)

The min operator.

infix:max(...)

The max operator.


parrot