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

[email protected] ((Randal L. Schwartz))
Newsgroups perl.perl6.language.objects
Message-ID <[email protected]>
>>>>> "Nathan" == Nathan Wiger <[email protected]> writes:

Nathan> The key difference is this: $_[0] always contains the first method
Nathan> argument, regardless of whether you're in an object-oriented or
Nathan> function-oriented context. So, if you need to support both (like CGI.pm
Nathan> and my own File::Remote must), you don't have to write some special
Nathan> method that detects whether $_[0] is a valid class ref (see
Nathan> self_or_default in CGI.pm).

yes, I like this.

Nathan> This fixes a lot of stuff. Plus, "self" is one char shorter than
Nathan> "shift"! ;-)

Heh!  All that typing I would have saved over the years, would
probably be equal to the number of characters I've typed here
debating this point. :)

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[email protected]> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
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.