Commit | Line | Data |
55a1c97c |
1 | ============================================================================== |
13021a80 |
2 | Release of version 0.50 of NEXT |
55a1c97c |
3 | ============================================================================== |
4 | |
5 | |
6 | NAME |
7 | |
8 | NEXT - Pseudo class for method redispatch |
9 | |
10 | |
11 | DESCRIPTION |
12 | |
13 | NEXT.pm adds a pseudoclass named C<NEXT> to any program that |
14 | uses it. If a method C<m> calls C<$self->NEXT::m()>, the call to |
15 | C<m> is redispatched as if the calling method had not originally |
16 | been found. |
17 | |
18 | In other words, a call to C<$self->NEXT::m()> resumes the |
19 | depth-first, left-to-right search of parent classes that |
20 | resulted in the original call to C<m>. |
21 | |
22 | Note that this is not the same thing as C<$self->SUPER::m()>, which |
23 | begins a new dispatch that is restricted to searching the ancestors |
24 | of the current class. C<$self->NEXT::m()> can backtrack past |
25 | the current class -- to look for a suitable method in other |
26 | ancestors of C<$self> -- whereas C<$self->SUPER::m()> cannot. |
27 | |
d1be9408 |
28 | A particularly interesting use of redispatch is in |
55a1c97c |
29 | C<AUTOLOAD>'ed methods. If such a method determines that it is |
30 | not able to handle a particular call, it may choose to |
31 | redispatch that call, in the hope that some other C<AUTOLOAD> |
32 | (above it, or to its left) might do better. |
33 | |
13021a80 |
34 | The module also allows you to specify that multiply inherited |
35 | methods should only be redispatched once, and what should |
36 | happen if no redispatch is possible. |
55a1c97c |
37 | |
38 | |
39 | AUTHOR |
40 | |
41 | Damian Conway (damian@conway.org) |
42 | |
43 | |
44 | COPYRIGHT |
45 | |
46 | Copyright (c) 2000-2001, Damian Conway. All Rights Reserved. |
47 | This module is free software. It may be used, redistributed |
48 | and/or modified under the same terms as Perl itself. |
49 | |
50 | |
51 | ============================================================================== |
52 | |
13021a80 |
53 | CHANGES IN VERSION 0.50 |
54 | |
55 | |
56 | - Added a $VERSION (oops!) |
57 | |
58 | - Fixed handling of diamond patterns (thanks Paul) |
59 | |
60 | - Added NEXT::ACTUAL to require existence of next method (thanks Paul) |
55a1c97c |
61 | |
13021a80 |
62 | - Added NEXT::UNSEEN to avoid calling multiply inherited |
63 | methods twice (thanks Paul) |
55a1c97c |
64 | |
13021a80 |
65 | - Re-fixed setting of $AUTOLOAD in NEXT'd AUTOLOADS to be |
66 | consistent with more useful SUPER:: behaviour |
55a1c97c |
67 | |
13021a80 |
68 | - Corified tests |
55a1c97c |
69 | |
70 | |
71 | ============================================================================== |
72 | |
73 | AVAILABILITY |
74 | |
75 | NEXT has been uploaded to the CPAN |
76 | and is also available from: |
77 | |
78 | http://www.csse.monash.edu.au/~damian/CPAN/NEXT.tar.gz |
79 | |
80 | ============================================================================== |