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

[email protected] ("Brust, Corwin")
Newsgroups perl.perl6.language.objects
Message-ID <[email protected]>
<snip>

-----Original Message-----
From: Damian Conway [mailto:[email protected]]

And don't forget to include my idea that $ME be scoped locally like
$AUTOLOAD, so that the "self" and "this" and "I" and "myself" camps can
have their respective cakes but the rest of us don't have to eat them:

[...]

        sub self() {$ME};

</snip>

wouldn't this be a little slower then say, a pragma?


	package MEish_module;
      use module qw($ME);
	method name($newval) {
		$ME->{name} = $newval if @_;
		return $ME->{name};
	}

	package selfish_module;
	use module qw($self);
	method name($newval) {
		$self->{name} = $newval if @_;
		return $self->{name};
	}


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