Luke Palmer <[EMAIL PROTECTED]> writes:
> Cool stuff. In my usual pedantic sort of way, I'll go through the
> message and fix everything you said. For educational purposes only, of
> course :-)
Thanks :-)
For further education, some more questions/comments, if I may:
> # Let's say C<is parsed> args come before the default infix args
> macro infix:[ ($op, $lhs, $rhs)
> is parsed( /:w (<Perl6.expr>) \]/ )
[snip]
> You shouldn't parse the right hand side yourself. That fixes the issue.
I was not aware of this option. A6/E6 gave me the impression that
C<is parsed> would override the default parsing of the RHS, not merely
augment it. Does the parsed-trait somehow interact with the signature
of the macro, to find out whether to extend or replace?
That is, can I write prefix:-macros that do not take the default RHS
parameters, but only the ones generated by C<is parsed>? Quotelike
operators come to mind:
macro prefix:qtex ($raw)
is parsed( /(<Perl6.delimited_balanced .*?>)/ ) { ... }
Or would that be accomplished by another keyword, indicating what,
in the absence of C<is parsed>, would be 0-ary? term:qtex, perhaps?
I guess that depends upon what kind of consistency you are aiming for.
> Do you I<want> to give me a heart attack? :-/
Nope. I will try to restrain myself.
> This would be fine, I think:
>
> sub eqn ($n) { &String::strncmp.assuming(n => $n) }
You mean it would be fine for using with the infix:[ macro, right?
But then you could not get the precedence you want. You would be
stuck with whatever precedence infix:[ was given.
Eirik
--
All bridge hands are equally likely, but some are more equally likely
than others.
-- Alan Truscott