Em Qua, 2009-04-01 às 05:41 -0700, Jon Lang escreveu:
> On Wed, Apr 1, 2009 at 5:07 AM, Daniel Ruoso <dan...@ruoso.com> wrote:
> > The concept of "invocant" only exists in terms of syntax now. In runtime
> > the invocant is simply the first positional argument. This simplifies
> > things a lot.
> I think you're confusing signatures with captures here.  Captures and
> the arguments that they, well, capture, don't care about the invocant;
> but signatures and the parameters that they define still do.

Not at all, if you declare a method with "my" or "our", it is seen as a
sub (as with "is export"), but it will still have the same signature.
So, the invocant only exists in the syntax even for signatures, in
runtime, they are simply the first argument... Which, in terms of code,
means:

 my method foo($b,$c) {...}
 $a.foo($b,c);
 foo($a,$b,$c);

In both invocations, $a is seen by foo as "self", because that is how
the signature is defined.

> >> * Why are we using ";;" to denote the end of a multi function's
> >> longname?
> > Because a capture may have more than one dimension, which would be
> > delimited by ";".
> Note that I didn't propose ";" as the longname terminator.

I see, but the idea of using ";;" is to be something invariably stronger
than ";" .

> ...nor would I expect it to.  I'm just wondering if (@_, %_) _are_
> still part of a placeholder-generated signature.  In short, is there a
> way to access a slurpy array or hash in a block that uses placeholder
> parameters?

I'd guess not, but I think it's a plain design decision. In my head, the
default slurpy only makes sense when no signature is provided at all,
and only for some mindset compatibility with Perl 5.

In fact... cases like:

  for 1,2,3,4,5,6 { say $^a, $^b }

Imply that you can't have the slurpies there, otherwise the for loop
would be run only once...

daniel 

Reply via email to