Skip to content

Commit 02669a0

Browse files
committed
Documents list → on the list side, closes #1245
1 parent 39fe1e4 commit 02669a0

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

doc/Type/List.pod6

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1270,6 +1270,23 @@ It does nothing, and returns C<Nil>, as the definition clearly shows.
12701270
12711271
sink [1,2,Failure.new("boo!"),"still here"]; # OUTPUT: «»
12721272
1273+
=head2 method Set
1274+
1275+
In general, creates a set which has as members elements of the list.
1276+
1277+
say <æ ß þ €>.Set ;# OUTPUT: «set(ß æ þ €)␤»
1278+
1279+
However, there might be some unexpected changes in case the list includes
1280+
non-scalar data structures. For instance, with L<Pair>s:
1281+
1282+
my @ary = (:42a, :33b);
1283+
say @ary.Set;# OUTPUT: «set(a b)␤»
1284+
1285+
The set will be composed of the C<key>s of the Pair whose corresponding value
1286+
is not 0, eliminating all the values. Please check the
1287+
L<C<Set> documentation|/type/Set#Creating_Set_objects> for more examples and a
1288+
more thorough explanation.
1289+
12731290
=head1 Operators
12741291
12751292
=head2 infix C«cmp»

0 commit comments

Comments
 (0)