Skip to content

Commit

Permalink
Quick implementation of Any.pairs.
Browse files Browse the repository at this point in the history
  • Loading branch information
colomon committed Mar 26, 2010
1 parent 208fcab commit f7d3461
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/core/Any-list.pm
Expand Up @@ -185,6 +185,10 @@ augment class Any {
take $value;
}
}

multi method pairs() {
self.kv.map(-> $key, $value { $key => $value; });
}
}

our proto sub join (Str $separator = '', *@values) { @values.join($separator); }
Expand All @@ -201,5 +205,6 @@ our proto sub map(&mapper, @values) { @values.map(&mapper); }
our proto sub kv(@array) { @array.kv; }
our proto sub keys(@array) { @array.keys; }
our proto sub values(@array) { @array.values; }
our proto sub pairs(@array) { @array.pairs; }

# vim: ft=perl6

0 comments on commit f7d3461

Please sign in to comment.