Skip to content

Commit

Permalink
Adds sum, refs #1494
Browse files Browse the repository at this point in the history
  • Loading branch information
JJ committed Feb 21, 2019
1 parent d3922e5 commit 7a8b99c
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions doc/Type/Any.pod6
Expand Up @@ -1304,6 +1304,21 @@ one has size 2 (because partials are allowed), and an overlap of 2 also.
Please see also L<C<list.rotor>|/type/List#method_rotor> for examples applied to
lists.
=head2 method sum
Defined as:
method sum() is nodal
If the content is iterable, it returns the sum of the values after pulling them
one by one.
=for code
(3,2,1).sum; # OUTPUT: «6␤»
say 3.sum; # OUTPUT: «3␤»
It will fail if any of the elements cannot be converted to a number.
=end pod

# vim: expandtab softtabstop=4 shiftwidth=4 ft=perl6

0 comments on commit 7a8b99c

Please sign in to comment.