Skip to content

Commit

Permalink
Make sure Int/Num/Numeric/Real work on QuantHashes
Browse files Browse the repository at this point in the history
  • Loading branch information
lizmat committed Oct 5, 2013
1 parent ae27d10 commit 9f94b8c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 0 additions & 2 deletions src/core/Baggy.pm
Expand Up @@ -15,8 +15,6 @@ my role Baggy does QuantHash {
%!elems.exists_key($k.WHICH);
}
method Bool { %!elems.Bool }
method Numeric { self.total }
method Real { self.total }

method hash(--> Hash) { %!elems.values.hash }
method invert(--> List) { %!elems.values.map: { ( .value => .key ) } }
Expand Down
4 changes: 4 additions & 0 deletions src/core/QuantHash.pm
@@ -1,2 +1,6 @@
my role QuantHash does Associative {
method Int ( --> Int) { self.total.Int }
method Num ( --> Num) { self.total.Num }
method Numeric ( --> Numeric) { self.total.Numeric }
method Real ( --> Real) { self.total.Real }
}
2 changes: 0 additions & 2 deletions src/core/Setty.pm
Expand Up @@ -15,8 +15,6 @@ my role Setty does QuantHash {
so nqp::existskey(%!elems, nqp::unbox_s($k.WHICH));
}
method Bool { %!elems.Bool }
method Numeric { %!elems.Numeric }
method Real { %!elems.Numeric.Real }

method hash(--> Hash) {
my %e;
Expand Down

0 comments on commit 9f94b8c

Please sign in to comment.