On 5/15/05, Juerd <[EMAIL PROTECTED]> wrote:
> Autrijus Tang skribis 2005-05-15 19:28 (+0800):
> > On Sun, May 15, 2005 at 01:19:53PM +0200, Juerd wrote:
> > > Or was your choice of words poor, and did you not mean to discuss the
> > > dot's *default*, but instead a standard way to write the current
> > > invocant?
> > I think what Rob suggested is that:
> >     method ($foo)
> > means
> >     method ($self: $foo)
> 
> Then I hereby apologise to Rob for my own poor choice of words.
> 
> I don't like the idea of having a normal identifier ever used by
> default, except $_, which is already aliased to the invocant.

Autrijus is much more eloquent that (apparently) I can ever hope to
be. Thank you.

If I understand correctly, we're discussing what should happen if you
do something like .method($foo) within another method and if there
should be shorthand way of writing whatever it is.

Right now, P6 has $?SELF and I'm saying that instead of using $?SELF,
we should use $self wherever $?SELF would be used. $_ is still the
topic and would be the default invocant if you have .method($foo).
What I'm saying is that you can have

method ( Int foo ) {
    $self.otherMethod( foo );
}

and it will DWIM. Just like Java, C++, and Javascript. (Yes, I'm using
JS as part of my argument.)

If you have
method ( Int foo ) {
    .otherMethod( foo );
}

That would be
method ( Int foo ) {
    $_.otherMethod( foo );
}

Just like expected.

Rob

Reply via email to