method list

Documentation for method list, assembled from the following types:

class Any

From Any

(Any) method list

Defined as:

method list(--> List:D)

Interprets the invocant as a list, and returns that List.

say 42.list.^name;           # OUTPUT: «List␤» 
say 42.list.elems;           # OUTPUT: «1␤» 

class Capture

From Capture

(Capture) method list

Defined as:

method list(Capture:D: --> Positional)

Returns the positional part of the Capture.

my Capture $c = \(235apples => (red => 2));
say $c.list;                                      # OUTPUT: «(2 3 5)␤» 

class Channel

From Channel

(Channel) method list

Defined as:

method list(Channel:D: --> List:D)

Returns a Seq which will iterate items in the queue and removes each item from the queue as it iterates. This can only terminate once the close method has been called.

my $c =$c.send(1); $c.send(2);
say $c.list# OUTPUT: «(1 2)␤» 

class Match

From Match

(Match) method list

Returns a list of positional submatches.

role PositionalBindFailover

From PositionalBindFailover

(PositionalBindFailover) method list

method list(PositionalBindFailover:D: --> List:D)

Returns a List based on the iterator method without caching it.

class Range

From Range

(Range) method list

method list(Range:D: --> List:D)

Generates the list of elements that the range represents.

say (1..5).list;                                  # OUTPUT: «(1 2 3 4 5)␤» 
say (1^..^5).list;                                # OUTPUT: «(2 3 4)␤» 

class Supply

From Supply

(Supply) method list

method list(Supply:D: --> List:D)

Taps the Supply it is called on, and returns a lazy list that will be reified as the Supply emits values. The list will be terminated once the Supply is done. If the Supply quits, then an exception will be thrown once that point in the lazy list is reached.