File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -309,6 +309,28 @@ L«C<.excludes-max>|/type/Range#method_excludes-max»,
309
309
L « C < .infinite > |/type/Range#method_infinite» , and
310
310
L « C < .is-int > |/type/Range#method_is-int» as named arguments.
311
311
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
+
312
334
= end pod
313
335
314
336
# vim: expandtab softtabstop=4 shiftwidth=4 ft=perl6
You can’t perform that action at this time.
0 commit comments