NAME ^

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

Object Methods ^

Scalar

When we're going to be stored as an item, become an Array and then return ourself in a ObjectRef.

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 Array).

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(...)

fmt

 our Str multi List::fmt ( Str $format, $separator = ' ' )
Returns the invocant list formatted by an implicit call to sprintf on each of the elements, then joined with spaces or an explicitly given separator.

grep(...)

iterator()

Returns an iterator for the list.

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(...)

uniq(...)

values()

Returns a List containing the values of the invocant.

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