On 15/05/05 11:17 -0400, Rob Kinyon wrote: > 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 ); > }
+1 FWIW, after reading this whole conundrum, I think that erring on the side of pragmatism seems like the right choice. If I jump into some source code and see: $self.some_such(); I am going to feel right at home. No doubt about it. As to *how* it works (by hook, crook, preclaration or macro etc), I leave it to Larry to do the proper hand waving to make it fit in cleanly (for some Wallian definition of clean). Cheers, Brian > 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