Skip to content

Commit b04cf9d

Browse files
author
Jan-Olof Hendig
committed
Added docs for Range.reverse. masak++, perlpilot++
1 parent 1f7b1ee commit b04cf9d

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

doc/Type/Range.pod6

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,4 +189,16 @@ Returns the sum of all elements in the Range. Throws X::Str::Numeric if an eleme
189189
190190
(1..10).sum #55
191191
192+
=head2 method reverse
193+
194+
method reverse(Range:D:) returns Seq:D
195+
196+
Returns a L<Seq> where all elements that the C<Range> represents have been
197+
reversed. Note that reversing an infinite C<Range> won't produce any meaningful
198+
results.
199+
200+
say (1^..5).reverse; # (5 4 3 2)
201+
say ('a'..'d').reverse; # (d c b a)
202+
say (1..Inf).reverse; # (Inf Inf Inf ...)
203+
192204
=end pod

0 commit comments

Comments
 (0)