On Tue Apr 28 07:44:46 2009, masak wrote:
> <masak> rakudo: grammar A { regex TOP { foo } }; A.parse("foo").say;
> say "bar"; A.parse("foo").print; say "bar"
> <p6eval> rakudo ae5e29: OUTPUT«foobarbar»
> * masak submits rakudobug
>
> Expected output: «foobarfoobar».
The problem here is that .print is conflicting with the pre-defined
<print> subrule for regexes (matching a printable character). I'm not
quite sure how to resolve this.
There are quite a few workarounds, however:
print(A.parse('foo'));
A.parse('foo').Str.print;
(~A.parse('foo')).print;
I'm not sure what the correct behavior should be here, so I'm converting
this ticket into a request to confirm/clarify the spec.
Thanks!
Pm