Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Make | flattening work on pairs, which flatten as named arguments.
  • Loading branch information
jnthn committed Jun 21, 2012
1 parent 65dc805 commit 4d79923
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/ChangeLog
Expand Up @@ -15,6 +15,7 @@ New in 2012.06
+ require with argument list
+ compile time errors in loaded modules now show a module loading backtrace
+ improved list and .map handling
+ can now use | to flatten a pair into an argument list as a named argument

New in 2012.05
+ meta ops //=, ||= and &&= now short-circuit properly
Expand Down
3 changes: 3 additions & 0 deletions src/core/Enum.pm
Expand Up @@ -36,6 +36,9 @@ my class Enum does Associative {
method at_key($key) {
$key eq $!key ?? $!value !! Mu
}

method FLATTENABLE_LIST() { nqp::list() }
method FLATTENABLE_HASH() { nqp::hash($!key, $!value) }
}

multi sub infix:<eqv>(Enum:D $a, Enum:D $b) {
Expand Down

0 comments on commit 4d79923

Please sign in to comment.