# New Ticket Created by Cory Spencer
# Please include the string: [perl #64360]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=64360 >
The attached patch allows Perl 6 classes to numify via a Num multi method
like the following:
class Foo {
our Num multi method Num {
return 12;
}
}
>From e55f63af638c4f6afe8313d8a5458b27db18ad76 Mon Sep 17 00:00:00 2001
From: git <[email protected]>
Date: Wed, 1 Apr 2009 19:05:11 -0700
Subject: [PATCH] Added "get_number" method to Object.pir to allow numification/intification of Perl 6 classes.
---
src/classes/Object.pir | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/src/classes/Object.pir b/src/classes/Object.pir
index 17f972e..919b213 100644
--- a/src/classes/Object.pir
+++ b/src/classes/Object.pir
@@ -717,6 +717,11 @@ Helper for doing calls on the metaclass.
.return ($S0)
.end
+.sub '' :vtable('get_number') :method
+ $N0 = self.'Num'()
+ .return ($N0)
+.end
+
.sub '' :vtable('increment') :method
$P0 = self.'succ'()
'infix:='(self, $P0)
--
1.6.0.6