# New Ticket Created by  Jarrod 
# Please include the string:  [perl #77412]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=77412 >


This is just a followup fix to ticket #75584 that pmichaud was going to do
but probably forgot about. Previously Parcel's hash method was delegating to
sub hash (which is backwards). I flipped it around to fix it.
>From 3c7766f14759919d0a2bb6ce4c4ab35c34ec0ead Mon Sep 17 00:00:00 2001
From: Jarrod <[email protected]>
Date: Tue, 24 Aug 2010 20:41:40 +1000
Subject: [PATCH] Make sub hash() call the .hash method on its arguments, and change Parcel to implement its own .hash method

---
 src/builtins/Parcel.pir |    9 ---------
 src/core/Parcel.pm      |    4 ++++
 src/core/operators.pm   |    3 +--
 3 files changed, 5 insertions(+), 11 deletions(-)

diff --git a/src/builtins/Parcel.pir b/src/builtins/Parcel.pir
index e0e9710..6fb697a 100644
--- a/src/builtins/Parcel.pir
+++ b/src/builtins/Parcel.pir
@@ -46,15 +46,6 @@ A Parcel in item context becomes a Seq.
 .end
 
 
-=item hash()
-
-=cut
-
-.sub 'hash' :method
-    .tailcall '&hash'(self)
-.end
-
-
 =item iterator()
 
 Construct an iterator for the Parcel.
diff --git a/src/core/Parcel.pm b/src/core/Parcel.pm
index c96e94b..b1b5e03 100644
--- a/src/core/Parcel.pm
+++ b/src/core/Parcel.pm
@@ -13,4 +13,8 @@ augment class Parcel does Positional {
             ?? $x.notdef || ($x ~~ Positional && $x == 0)
             !! self.Seq.ACCEPTS($x)
     }
+
+    method hash() {
+        my %h = self.list;
+    }
 }
diff --git a/src/core/operators.pm b/src/core/operators.pm
index c8d8915..5e21f2a 100644
--- a/src/core/operators.pm
+++ b/src/core/operators.pm
@@ -205,8 +205,7 @@ our sub circumfix:<{ }>(*...@elements) {
 }
 
 our sub hash(*...@list, *%hash) {
-    my %h = (@list, %hash);
-    %h
+    %(@list, %hash);
 }
 
 our multi infix:sym<//>(Mu $a, Mu $b) {
-- 
1.7.0.4

Reply via email to