This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=head2 method roll | |
Defined as: | |
multi method roll(Baggy:D:) returns Any:D | |
multi method roll(Baggy:D: $count) returns Seq:D | |
Like an ordinary list L<roll|/type/List/#routine_roll>, but returns keys of the invocant weighted | |
by their values, as if the keys were replicated the number of times indicated | |
by the corresponding value and then list roll used. The underlying |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=head2 method pick | |
Defined as: | |
multi method pick(Baggy:D:) returns Any | |
multi method pick(Baggy:D: $count) returns Seq:D | |
Like an ordinary list L<pick|/type/List#routine_pick>, but returns keys | |
of the invocant weighted by their values, as if the keys were replicated | |
the number of times indicated by the corresponding value and then list |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=head2 method pickpairs | |
Defined as: | |
multi method pickpairs(Baggy:D:) returns Pair:D | |
multi method pickpairs(Baggy:D: $count) returns List:D | |
Returns a C<Pair> or a C<List> of C<Pair>s depending on the version of the method | |
being invoked. Each C<Pair> returned has an element of the invocant as its key and the | |
elements weight as its value. The elements are 'picked' without replacement. If C<*> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=head2 method grabpairs | |
Defined as: | |
multi method grabpairs(Baggy:D:) returns Any | |
multi method grabpairs(Baggy:D: $count) returns List:D | |
Returns a C<Pair> or a C<List> of C<Pair>s depending on the version of the method | |
being invoked. Each C<Pair> returned has an element of the invocant as its key and the | |
elements weight as its value. Unlike L<pickpairs>, it works only on mutable structures, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=head2 method pairs | |
Defined as: | |
method pairs(Baggy:D:) returns Seq:D | |
Returns all elements and their respective weights as a L<Seq|/type/Seq> of C<Pair>s | |
where the key is the element itself and the value is the weight of that element. | |
my $breakfast = bag <bacon eggs bacon>; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=head2 method antipairs | |
Defined as: | |
method antipairs(Baggy:D:) returns Seq:D | |
Returns all elements and their respective weights as a L<Seq|/type/Seq> of C<Pair>s | |
where the element itself is the value and the weight of that element is the key, i.e. | |
the opposite of method L<pairs|#method pairs>. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=head2 method antipairs | |
Defined as: | |
method antipairs(Map:D:) returns Seq:D | |
Returns all keys and their respective values as a L<Seq|/type/Seq> of C<Pair>s | |
where the keys and values have been exchanged, i.e. the opposite of method | |
L<pairs|#method_pairs>. Unlike the L<invert|#method_invert> method, there is | |
no attempt to expand list values into multiple pairs. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# I have made changes to Map.pod which are not shown on doc.perl6.org nor locally after having run htmlify.doc | |
# here's the timestamp for my copy of doc/Type/Map.pod | |
Cdogbert@dogbert-VirtualBox ~/repos/doc $ ls -l doc/Type/Map.pod | |
-rw-r--r-- 1 dogbert dogbert 4599 Jun 25 13:54 doc/Type/Map.pod | |
# running htmlify.p6 with the env var RAKUDO_MODULE_DEBUG=1 yields interesting results | |
46/240: doc/Type/Map.pod => type/Map | |
extract-pod: doc/Type/Map.pod which was modified 2016-06-25T11:54:25.455538Z # this printout added by dogbert17 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=head2 method minmax | |
Defined as: | |
multi method minmax(Range:D:) returns List:D | |
If the C<Range> is an integer range (as indicated by L<is-int>), then this | |
method returns a list with the first and last value it will iterate over | |
(taking into account L<excludes-min> and L<excludes-max>). If the range is | |
not an integer range, the method will return a two element list containing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=head2 method app_lifetime | |
method app_lifetime(Thread:D:) returns Bool:D | |
Returns C<False> unless the named parameter C<:app_lifetime> is specifically set | |
to C<True> during object creation. If the method returns C<False> it means that the | |
the process will only terminate when the thread has finished while C<True> means that | |
the thread will be killed when the main thread of the process terminates. | |
my $t1 = Thread.new(code => { for 1..5 -> $v { say $v }}); |