File tree Expand file tree Collapse file tree 1 file changed +0
-31
lines changed Expand file tree Collapse file tree 1 file changed +0
-31
lines changed Original file line number Diff line number Diff line change @@ -309,37 +309,6 @@ 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 target 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
- my $r-multiply = $r.clone-with-op( &[*], 2 ); # produces 2..10
330
- = end code
331
-
332
- The method applies the specified operator to the C < min > and C < max >
333
- properties of the C < Range > .
334
-
335
- It is possible to clone non-numeric ranges, but both the operator and
336
- value must be of the according type:
337
-
338
- = begin code
339
- my $r = 'a'..'c';
340
- my $r-cat = $r.clone-with-op( &[~], 'd' ); # produces 'ad'..'cd'
341
- = end code
342
-
343
312
= end pod
344
313
345
314
# vim: expandtab softtabstop=4 shiftwidth=4 ft=perl6
You can’t perform that action at this time.
0 commit comments