Larry Wall larry-at-wall.org |Perl 6| wrote:
On Wed, Apr 02, 2008 at 06:08:55PM -0700, Jon Lang wrote:
: In "Question on your last change to S02", Larry Wall wrote:
: > (By the way, you'll note the utility of being able to talk about a
: > postfix by saying ., which is one of the reasons we allow the optional
: > dot there. :)
: Can I take this as an indication that the rules for postcircumfix
: operators are an extension of the rules for postfix operators?
Yes, postcircumfixes are just strange postfixes, syntactically
speaking. Semantically they may do strange things such as behave
more like macros than operators, of course. Certainly .() is highly
magical that way, and maybe subscripts too.
I take it that the macro-like behavior is in how the circumscribed text
is parsed, and once that has been collected, it behaves just like a
function call to a function named postcircumfix:<( )> etc.?
And if I create a function named postcircumfix:<[ ]> (or one of the
others), I get the _same_ magic as normally applied to subscripts? If
it's a matter of defining the argument as @@ (for subscripts) or Capture
(for function-call syntax), that's not magic.