From 558c63838e4925c7ed9b1a0b9b1304a4b184a94d Mon Sep 17 00:00:00 2001 From: Jonathan Worthington Date: Sun, 14 Mar 2010 22:05:07 +0100 Subject: [PATCH] Apply patch from colomon++ to move Int.ACCEPTS into the setting. --- src/builtins/Int.pir | 9 --------- src/core/Int.pm | 8 ++++++++ 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/builtins/Int.pir b/src/builtins/Int.pir index cacb924390b..2f218e32069 100644 --- a/src/builtins/Int.pir +++ b/src/builtins/Int.pir @@ -18,15 +18,6 @@ Int - Perl 6 integers intproto = p6meta.'new_class'('Int', 'parent'=>'parrot;Integer Any') .end -=item ACCEPTS() - -=cut - -.sub 'ACCEPTS' :method - .param num topic - .tailcall '&infix:<==>'(topic, self) -.end - =item perl() Returns a Perl representation of the Int. diff --git a/src/core/Int.pm b/src/core/Int.pm index 69c62795e15..41ecbebfe95 100644 --- a/src/core/Int.pm +++ b/src/core/Int.pm @@ -18,6 +18,14 @@ augment class Int { self < 0 ?? -self !! self; } + multi method ACCEPTS(Int $other) { + self == $other; + } + + multi method ACCEPTS($other) { + self.Num.ACCEPTS($other); + } + our Bool multi method Bool() { self != 0 ?? Bool::True !! Bool::False } our Int multi method Int() { self }