Since afaict this is not specced, I'll hand that over to p6l. Eric Hodges (via RT) wrote: > use v6; > > rule test {test}; > > "test" ~~ /<test>/; > say '$/.keys => ', $/.keys.perl; > say '%($/).keys => ', %($/).keys.perl; > > # outputs > # $/.keys => [] > # %($/).keys => ["test"] > > > Same could be said for .values and .kv > > It would be very DWIM for it to act like a hash in these cases by default.
Actually I think it would DWIM more in the general case if Match.keys (and .kv, .pairs, .values etc) would give a list of the array and hash part, so $/.keys would be @($/).keys, %($/).keys. Your suggestion would be just a degenerate case of that. Any thoughts on that? Cheers, Moritz