Piers Cawley writes:
> Larry Wall <[EMAIL PROTECTED]> writes:
> 
> > I've been thinking about this in my sleep, and at the moment I think
> > I'd rather keep .foo meaning $_.foo, but break the automatic binding
> > of the invocant to $_.  Instead of that, I'd like to see a really,
> > really short alias for $self.  Suppose we pick "o" for that, short
> > for "object".  Then we get self calls of the form:
> >
> >     o.frobme(...)
> 
> 
> I really, really don't want to see .foo meaning anything but $_.foo, so how
> about arranging things so that the invocant becomes $_ iff you don't give it a
> name.

The problem with that is that people start learning that .foo means call
foo on the current object, and then they write:

    method iterate () {
        for (@.objs) {
            .process($_);   # oops
        }
    }

And they may even know the rule, but $_ is a hard thing to get used to
in Perl.  I think it's best is "call a method on the current object"
looks the same everywhere it is used.

Luke

Reply via email to