values
ErrorsCollection

values

Synthesised documentation from type/Baggy type/Any type/Setty type/Map type/Capture type/Pair type/List

From type/Baggy

See Original text in context

method values(Baggy:D: --> Seq:D)

Returns a Seq of all values, i.e. weights, in the Baggy object.

my $breakfast = bag <eggs spam spam spam>;
say $breakfast.values.sort;                      # OUTPUT: «(1 3)␤» 
 
my $n = ("a" => 5"b" => 2"a" => 1).BagHash;
say $n.values.sort;                              # OUTPUT: «(2 6)␤»

From type/Any

See Original text in context

multi method values(Any:U:)
multi method values(Any:D:)

Will return an empty list for undefined or class arguments, and the object converted to a list otherwise.

say (1..3).values# OUTPUT: «(1 2 3)␤» 
say List.values;   # OUTPUT: «()␤»

From type/Setty

See Original text in context

multi method values(Setty:D: --> Seq:D)

Returns a Seq containing as many True values as the set has elements.

my $s = Set.new(123);
say $s.values;                                    # OUTPUT: «(True True True)␤»

From type/Map

See Original text in context

method values(Map:D: --> Seq:D)

Returns a Seq of all values in the Map.

my $m = Map.new('a' => (23), 'b' => 17);
say $m.values# OUTPUT: «((2 3) 17)␤»

From type/Capture

See Original text in context

multi method values(Capture:D: --> Seq:D)

Returns a Seq containing all positional values followed by all named argument values.

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

From type/Pair

See Original text in context

multi method values(Pair:D: --> List:D)

Returns a List containing the value of the invocant.

say (Raku => "d").values;                         # OUTPUT: «(d)␤»

From type/List

See Original text in context

sub    values($list --> Seq:D)
method values(List:D: --> Seq:D)

Returns a sequence of the list elements, in order.

say (1,2,3,4).^name;        # OUTPUT: «List␤» 
say (1,2,3,4).values.^name# OUTPUT: «Seq␤»