File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -745,8 +745,8 @@ Examples:
745
745
746
746
Defined as:
747
747
748
- multi sub squish(*@values, :&as --> Seq:D)
749
- multi method squish(List:D: :&as --> Seq:D)
748
+ multi sub squish(*@values, :&as, :&with --> Seq:D)
749
+ multi method squish(List:D: :&as, :&with --> Seq:D)
750
750
751
751
Returns a sequence of values from the invocant/argument list where runs
752
752
of more than one value are replaced with only the first instance.
@@ -764,6 +764,13 @@ Examples:
764
764
The optional C < :as > parameter, just like with L < C < unique > > , allows values to be
765
765
temporarily transformed before comparison.
766
766
767
+ The optional C < :with > parameter is used to set an appropriate comparsion operator:
768
+
769
+ say [42, "42"].squish; # OUTPUT: «(42 42)»
770
+ # Note that the second item in the result is still Str
771
+ say [42, “42”].squish(with => &infix:<eq>); # OUTPUT: «(42)»
772
+ # The resulting item is Int
773
+
767
774
= head2 routine reduce
768
775
769
776
Defined as:
You can’t perform that action at this time.
0 commit comments