Re: RFC 152 (v1) Replace $self in @_ with self() builtin (not $ME )

[email protected] (John Siracusa)
Newsgroups perl.perl6.language.objects
Message-ID <B5D03A70.1DA7C%[email protected]>
On 8/28/00 3:35 PM, Damian Conway wrote:
>> ...while also giving the compiler enough information to allow such
>> invocant access to execute in an optimized manner...right? C'mon,
>> I'm dying here thinking that all this (admittedly cool) stuff is
>> gonna end up giving Perl 6 even more OO overhead than Perl 5!
> 
> Use invocant won't add any runtime overhead. In fact it might save a smidgeon.

No no, you're supposed to say "I have a great plan whereby it'll be at least
2x faster!" ;)

>> (What was it in the current edition..."up to 20x slower"? *sigh*)
> 
> Out by a factor of 10! I said "20 to 50 percent slower".

Getting senile in my old age...
 
> I think they would *improve* readability. Certainly over $_[0], and
> even over:
> 
> sub method {
> my ($self, @args) = @_;
> ...
> }
> 
> I'm *forever* writing that and just it clutters up the code.

I agree, but any implicit self is nicer than the status quo, IMO.

I was talking about the hypothetical situation where you're (re)using or
modifying a bunch of code or classes written by different people and you
constantly have to be aware of which self-thingie to use in which file or
package or whatever.  Yeah, you can just glance up to the use ...
declaration, but it still seems a little like trying to make everyone
happy by avoiding the naming decision entirely.

Too much B&D for a Monday?

-John
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.