Permalink
Browse files

Pair.ACCEPTS

  • Loading branch information...
1 parent 9e91676 commit 1f8fe70bf32e3416e3da803fceced76a03d8d156 @moritz moritz committed Jul 6, 2011
Showing with 7 additions and 0 deletions.
  1. +7 −0 src/core/Pair.pm
View
@@ -1,5 +1,12 @@
my class Pair is Enum does Associative {
# method value() is rw { ... }
+
+ multi method ACCEPTS(Pair:D: %h) {
+ $.value.ACCEPTS(%h{%.key});
+ }
+ multi method ACCEPTS(Pair:D: Mu $other) {
+ $other."$.key"().Bool === $.value.Bool
+ }
}
sub infix:«=>»($key, Mu $value) {

0 comments on commit 1f8fe70

Please sign in to comment.