Skip to content

Commit ae9efa5

Browse files
committed
Document Range.clone-with-op.
See issue #1798.
1 parent 912e133 commit ae9efa5

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

doc/Type/Range.pod6

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,28 @@ L«C<.excludes-max>|/type/Range#method_excludes-max»,
309309
L«C<.infinite>|/type/Range#method_infinite», and
310310
L«C<.is-int>|/type/Range#method_is-int» as named arguments.
311311
312+
313+
=head2 method clone-with-op
314+
315+
Defined as
316+
317+
method clone-with-op(&op, $value --> Range:D)
318+
319+
The method clones the specified range applying the specified
320+
operator C<op> with the specified C<value> to the current C<Range>
321+
boundaries.
322+
323+
For instance:
324+
325+
=begin code
326+
my $r = 1..5;
327+
my $r-plus = $r.clone-with-op( &[+], 7 ); # produces 8..12
328+
my $r-minus = $r.clone-with-op( &[-], 7 ); # produces -6..-2
329+
=end code
330+
331+
The method applies the specified operator to the C<min> and C<max>
332+
properties of the C<Range>.
333+
312334
=end pod
313335

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

0 commit comments

Comments
 (0)