in reply to Re: $functions xor $methods
in thread $functions xor $methods
why not do this:sub foo { my ($self, $data) = @_; $self->{bar} = $self->method($data); }
Then the interface to the method will remain subclassable, but you don't have the performance hit of a method call. As long as this stays hidden inside the class, and you know the method you want to call is in the class and not a superclass, I don't see what the problem would be.sub foo { my ($self, $data) = @_; $self->{bar} = method($self, $data); }
kelan
Perl6 Grammar Student
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: $functions xor $methods
by Aristotle (Chancellor) on Oct 30, 2002 at 13:26 UTC | |
by tye (Sage) on Oct 30, 2002 at 15:20 UTC |