Skip to content

Commit

Permalink
Add &infix:«=>» and Enum.perl.
Browse files Browse the repository at this point in the history
  • Loading branch information
pmichaud committed Jun 18, 2011
1 parent 4d4bfa6 commit a02622b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/core/Enum.pm
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ my class Enum {
method value() { $!value }

multi method Str(Enum:D:) { $.key ~ "\t" ~ $.value }
multi method perl(Enum:D:) { $.key.perl ~ ' => ' ~ $.value.perl }
}

4 changes: 4 additions & 0 deletions src/core/Pair.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@ my class Pair is Enum {
# method value() is rw { ... }
}

sub infix=>»($key, Mu $value) {
Pair.new(:key($key), :value($value))
}

0 comments on commit a02622b

Please sign in to comment.