Skip to content

Commit

Permalink
Apply patch from colomon++ to move Int.ACCEPTS into the setting.
Browse files Browse the repository at this point in the history
  • Loading branch information
jnthn committed Mar 14, 2010
1 parent 9ffe679 commit 558c638
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
9 changes: 0 additions & 9 deletions src/builtins/Int.pir
Expand Up @@ -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.
Expand Down
8 changes: 8 additions & 0 deletions src/core/Int.pm
Expand Up @@ -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 }
Expand Down

0 comments on commit 558c638

Please sign in to comment.