Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[S32/Containers] removed parameter to .keys etc
You could match on indexes/keys using an optional parameter on the .keys,
.values, .pairs, .enums, .kv methods. I discovered this by accident, and
went to check the source of both Rakudo and Niecza. Neither implements this
parameter. It's a very old parameter, but it seems no-one has cared about
it enough to ask for it or implement it. Besides, there are better, more
readable ways to accomplish the same thing:
%h.values(/^prefix/); # instead of this...
%h.pairs.grep({.key ~~ /^prefix/})».value; # ...do this
%h.kv.map({ $^value if $^key ~~ /^prefix/ }); # ...or this
%h{%h.keys.grep(/^prefix/)}; # ...or even this
There are plenty of alternative ways to emulate the functionality that
the parameter provided, all of them (in my opinion) more tractable.- Loading branch information