Skip to content

Commit

Permalink
implement Hash.reverse
Browse files Browse the repository at this point in the history
also remove a method that accidentally sneaked into Str.pm
  • Loading branch information
moritz committed Feb 20, 2009
1 parent f7c0c0b commit ab75eb1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
1 change: 1 addition & 0 deletions build/Makefile.in
Expand Up @@ -108,6 +108,7 @@ BUILTINS_PIR = \
SETTING = \
src/setting/Array.pm \
src/setting/Bool.pm \
src/setting/Hash.pm \
src/setting/List.pm \
src/setting/Pair.pm \
src/setting/Str.pm \
Expand Down
9 changes: 9 additions & 0 deletions src/setting/Hash.pm
@@ -0,0 +1,9 @@
class Hash is also {
our Hash multi method reverse ( %hash: ) is export {
my %result;
(%result).{%hash.values} = %hash.keys;
%result;
}
}

# vim: ft=perl6
4 changes: 0 additions & 4 deletions src/setting/Str.pm
@@ -1,8 +1,4 @@
class Str is also {
our Bool multi method ACCEPTS ($topic) {
self eq $topic;

}
our Str multi method reverse ($str: ) {
return $str.split('').reverse.join;
}
Expand Down

0 comments on commit ab75eb1

Please sign in to comment.