Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Hash in list context behaves like a list of pairs
Signed-off-by: Moritz Lenz <moritz@faui2k3.org>
  • Loading branch information
patrickas authored and moritz committed May 19, 2010
1 parent 248ae36 commit c4de1a7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/core/Hash.pm
Expand Up @@ -102,6 +102,10 @@ role Hash is EnumMap {
}
}
method list() {
return self.pairs;
}
multi method sort(&by = &infix:<cmp>) {
self.pairs.sort(&by)
}
Expand Down

0 comments on commit c4de1a7

Please sign in to comment.