Lines Matching defs:method

29 sub method {
30 my $method = mro::_nextcan($_[0], 1);
31 goto &$method;
37 sub method {
38 my $method = mro::_nextcan($_[0], 0);
39 goto &$method if defined $method;
53 use mro; # enables next::method and friends globally
61 with method resolution order and method caching in general.
73 The special methods C<next::method>, C<next::can>, and
74 C<maybe::next::method> are not available until this C<mro> module
87 C3 is the name of an algorithm which aims to provide a sane method
123 classes one would search when resolving a method on that class,
148 keep track of method/MRO cache invalidations.
153 effectively descendants for method inheritance purposes.
167 Increments C<PL_sub_generation>, which invalidates method
172 Invalidates the method cache of any classes dependent on the
174 known case where pure perl code can confuse the method
184 real local method in the package C<$classname> changes,
191 looked. It does not increment on method/C<@ISA>
209 =head2 next::method
211 This is somewhat like C<SUPER>, but it uses the C3 method
215 given class, C<next::method> only uses the C3 MRO.
221 my $superclass_answer = $self->next::method(@_);
225 Note that you don't (re-)specify the method name.
226 It forces you to always use the same method name
227 as the method you started in.
231 The way it resolves which actual method to call is:
242 Then, it determines the class and method name
250 method with the same name as the contextually
251 enclosing method.
255 Failure to find a next method will result in an
265 B<Caveat>: Calling C<next::method> from methods defined outside the class:
267 There is an edge case when using C<next::method> from within a subroutine
272 *Foo::foo = sub { (shift)->next::method(@_) };
276 C<__ANON__> and not C<foo> as you might expect. Since C<next::method> uses
277 C<caller> to find the name of the method it was called in, it will fail in
285 *Foo::foo = subname 'Foo::foo' => sub { (shift)->next::method(@_) };
291 This is similar to C<next::method>, but just returns either a code
295 =head2 maybe::next::method
299 $self->next::method(@_) if $self->next::can;
302 works (like C<goto &maybe::next::method>);