Created
June 17, 2010 08:06
-
-
Save snarkyboojum/441829 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/core/Any-list.pm b/src/core/Any-list.pm | |
index 2307c03..9890290 100644 | |
--- a/src/core/Any-list.pm | |
+++ b/src/core/Any-list.pm | |
@@ -35,6 +35,7 @@ augment class Any { | |
our multi method sort(&by = &infix:<cmp>) { self.list.sort(&by); } | |
+ method rotate($n = 1) { self.list.rotate($n); } | |
multi method first(Mu $test) { | |
for @.list { | |
@@ -295,6 +296,7 @@ proto sub kv(@array) { @array.kv; } | |
proto sub keys(@array) { @array.keys; } | |
proto sub values(@array) { @array.values; } | |
proto sub pairs(@array) { @array.pairs; } | |
+proto sub rotate(@array, $n = 1) { @array.rotate($n); } | |
multi sub sort(*@values, :&by) { | |
my &x = &by // (@values[0] ~~ Callable ?? @values.shift !! &infix:<cmp> ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment