On 8/19/00 4:04 PM, Damian Conway wrote: > You can have your cake, but not force us to eat it too... Come, partake of the Loony Cake... :) > Like $AUTOLOAD, $ME would be dynamically scoped: > > package LoonyBin; > > sub self {$ME}; > > sub get_polite_age : method { > return (self->age >= 40) ? 39 : self->age; > } Sure, provided that's standardized via... > One might even imagine a standard pragma that automatically creates > such things in any package with methods. ...and, most importantly, cleverly morphed into an efficient implementation behind the scenes. We're supposed to be making Perl o-o *more* efficient, not adding more subroutine calls. Convenience and performance should not always have to be mutually exclusive. > We seem to cope with $AUTOLOAD okay, without the need to: > > sub autoload : lvalue {$AUTOLOAD} > > all the time. The operative word being "cope" ;) Also, I tend to write many more methods than I do autoloaders (YMMV), so I'd almost definitely use an efficient, convenient, implicit "self" bareword or scalar, whereas I'd probably just stick with $AUTOLOAD the few times I have to use it. -John
- Re: RFC 124 (v1) Sort order for any hash David L. Nicol
- Re: RFC 124 (v1) Sort order for any hash David L. Nicol
- Re: RFC 124 (v1) Sort order for any hash Damian Conway
- Re: RFC 124 (v1) Sort order for any hash Jeremy Howard
- Re: RFC 124 (v1) Sort order for any hash Damian Conway
- Re: RFC 124 (v1) Sort order for any hash David L. Nicol
- Re: RFC for $ME class variable (was Re: R... Damian Conway
- Re: RFC for $ME class variable (was Re... Randal L. Schwartz
- Re: RFC for $ME class variable (w... John Siracusa
- Re: RFC for $ME class variable (w... Damian Conway
- Re: RFC for $ME class variable (w... John Siracusa
- Re: RFC for $ME class variable (w... Nathan Wiger
- Re: RFC for $ME class variable (w... Bart Lateur
- Re: RFC for $ME class variable (w... Nathan Wiger
- Re: RFC for $ME class variable (w... Randal L. Schwartz
- Re: RFC for $ME class variable (w... Bryan C . Warnock
- Re: RFC for $ME class variable (w... Graham Barr
- Re: RFC for $ME class variable (was Re... Piers Cawley
- Re: RFC for $ME class variable (was Re... David L. Nicol
- RFC for $ME class variable (was Re: RFC 12... Nathan Wiger
- Re: RFC 124 (v1) Sort order for any hash Damian Conway