NAME ^

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

Methods ^

item

A List in item context becomes an Array.

list

A List in list context returns itself.

Coercion methods ^

Iterator

Scalar

A list in Scalar context becomes an Array ObjectRef.

ResizablePMCArray.list

This version of list morphs a ResizablePMCArray into a List.

Methods ^

elems()

Return the number of elements in the list.

perl()

Returns a Perl representation of a List.

Private 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.

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 ^

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