TSa wrote:
> Jon Lang wrote:
>>   item($x) # Dwimmey use of item context.
>
> IIRC this is the same as $$x, right? Or does that
> extract the invocant slot without dwimmery?

Umm... good question.  This is a rather nasty paradox: on the one
hand, we want to be able to stack $, @, and % with capture objects in
analogy to Perl 5's references, which would indicate that they should
tie directly to the invocant, positional parameters, and named
parameters, respectively.  OTOH, the intuitive meaning for these
symbols would seem to be "item context", "list context", and "hash
context", respectively, which would argue for the dwimmery.

The question is which of these two sets of semantics should be
emphasized; once that's answered, we need to be sure to provide an
alternative syntax that gives us the other set.  IOW, which one of
these is "make common things easy", and which one is "make uncommon
things possible"?

>>   $x._ # the Capture object's invocant, as an item.
>
> How about $x.() here? That looks symmetric to the other
> postfix operators and should be regarded as a method
> dispatched on the invocant or some such.

Symmetric, but ugly.  I suggested the underscore because '.foo' is the
same as '$_.foo'; so you can think of the invocant of a capture object
as being roughly analogous to a topic.

-- 
Jonathan "Dataweaver" Lang

Reply via email to