Re: RFC for $ME class variable (was Re: RFC 124 (v1) Sort order for any hash)

[email protected] (Damian Conway)
Newsgroups perl.perl6.language.objects
Message-ID <[email protected]>
From his padded room, Randal suggested:

   > >>>>> "John" == John Siracusa <[email protected]> writes:
   > 
   > John> I don't like $ME either, but my alternative is probably even more
   > John> blasphemous: use $self.  
   > 
   > John> But wait, it gets worse:  I'd even be happy with the bareword "self"
   > 
   > I'll have an adjacent cell.  I actually like that *better* than $self.


You can have your cake, but not force us to eat it too...

Like $AUTOLOAD, $ME would be dynamically scoped:

	package LoonyBin;

	sub self {$ME};

	sub get_polite_age : method {
		return (self->age >= 40) ? 39 : self->age;
	}


One might even imagine a standard pragma that automatically creates
such things in any package with methods.

We seem to cope with $AUTOLOAD okay, without the need to:

	sub autoload : lvalue {$AUTOLOAD}

all the time.

Damian
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.