# New Ticket Created by Stephane Payrard # Please include the string: [perl #77146] # in the subject line of all future correspondence about this issue. # <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=77146 >
I edited my garbled sentences. [15:28:22] <cognominal> I know that a match is both an array and a hash and that both containers have a .keys method. But I would expect .keys for a Match to return a list of the named reductions [15:28:37] <cognominal> rakudo: grammar A { token TOP { <a> }; token a { a } }; class A::A { method TOP($/) { say $<a>.keys }} ; A.parse( 'a', :actions(A::A)) [15:28:42] <p6eval> rakudo 4bd478: OUTPUT«» [15:29:09] <moritz_> the spec isn't clear on that point [15:31:36] <cognominal> I think it can be useful on actions for a rule that is a mere alternation list. method alternation($/) { make $/."{($/.keys)[0]}".ast } # if I got that right [15:32:00] <masak> fwiw, I'd also expect the subrule names from .keys [15:32:31] <moritz_> cognominal: are you sure you don't want .caps for that? [15:33:06] * masak .oO( .shower-caps ) [15:33:24] <moritz_> that said, I could very well live with Match.keys returning (Match.list.keys, Match.hash.keys) [15:33:41] <moritz_> and likewise .values and .kv -- cognominal stef