Documentation for method
list assembled from the following types:
multi method list(Any: --> List)multi method list(Any \SELF: --> List)
say 42.list.^name; # OUTPUT: «List␤»say 42.list.elems; # OUTPUT: «1␤»
my = $[1,2,3];say .perl; # OUTPUT: «$[1, 2, 3]␤»my = @;say .^name; # OUTPUT: «Array␤»
In the first case, the list is itemized.
@ as a prefix puts the initial scalar in a list context by calling
.list and turning it into an
multi method list(Backtrace:)
Returns a list of Backtrace::Frame objects for this backtrace.
Returns the positional part of the Capture.
my Capture = \(2, 3, 5, apples => (red => 2));say .list; # OUTPUT: «(2 3 5)␤»
method list(Channel: --> List)
Returns a list based on the
Seq which will iterate items in the queue and remove each item from it as it iterates. This can only terminate once the
close method has been called.
my = Channel.new; .send(1); .send(2);.close;say .list; # OUTPUT: «(1 2)␤»
Returns a list of positional submatches.
method list(PositionalBindFailover: --> List)
Returns a List based on the
iterator method without caching it.
method list(Range: --> List)
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)␤»
method list(Supply: --> List)
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
done. If the
quits, then an exception will be thrown once that point in the lazy list is reached.