Skip to content

Instantly share code, notes, and snippets.

@snarkyboojum
Created June 17, 2010 08:15
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save snarkyboojum/441834 to your computer and use it in GitHub Desktop.
From c30e257b7ef9c2d5768d5234e9c805dcf907e410 Mon Sep 17 00:00:00 2001
From: snarkyboojum <snarkyboojum@gmail.com>
Date: Thu, 17 Jun 2010 18:14:39 +1000
Subject: [PATCH] Get rotate working for Parcel again
---
src/core/Any-list.pm | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
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> );
--·
1.7.0.4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment