Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Documents list → on the list side, closes #1245
  • Loading branch information
JJ committed Jun 9, 2018
1 parent 39fe1e4 commit 02669a0
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions doc/Type/List.pod6
Expand Up @@ -1270,6 +1270,23 @@ It does nothing, and returns C<Nil>, as the definition clearly shows.
sink [1,2,Failure.new("boo!"),"still here"]; # OUTPUT: «»
=head2 method Set
In general, creates a set which has as members elements of the list.
say <æ ß þ €>.Set ;# OUTPUT: «set(ß æ þ €)␤»
However, there might be some unexpected changes in case the list includes
non-scalar data structures. For instance, with L<Pair>s:
my @ary = (:42a, :33b);
say @ary.Set;# OUTPUT: «set(a b)␤»
The set will be composed of the C<key>s of the Pair whose corresponding value
is not 0, eliminating all the values. Please check the
L<C<Set> documentation|/type/Set#Creating_Set_objects> for more examples and a
more thorough explanation.
=head1 Operators
=head2 infix C«cmp»
Expand Down

2 comments on commit 02669a0

@rafaelschipiura
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does .Set have any other special handling for Lists other than Lists of Pairs? If so, we should list all of them here instead of just leaving it to the user to wonder.

Also need to create an equivalent section in the Hash page saying it does the same, discards all pairs that have false values and keeps just the true ones.

@JJ
Copy link
Contributor Author

@JJ JJ commented on 02669a0 Jun 9, 2018 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.