From: Florian Ragwitz Date: Sat, 19 Jun 2010 08:03:21 +0000 (+0200) Subject: Fix various doc errors X-Git-Tag: 0.23~1 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7eb04689343a6339aa05446bda353d2902195c00;p=gitmo%2FClass-C3.git Fix various doc errors --- diff --git a/lib/Class/C3.pm b/lib/Class/C3.pm index 9268c6b..0978941 100644 --- a/lib/Class/C3.pm +++ b/lib/Class/C3.pm @@ -279,7 +279,7 @@ to using this implementation on older perls. =head2 What is C3? C3 is the name of an algorithm which aims to provide a sane method resolution order under multiple -inheritence. It was first introduced in the langauge Dylan (see links in the L section), +inheritance. It was first introduced in the langauge Dylan (see links in the L section), and then later adopted as the prefered MRO (Method Resolution Order) for the new-style classes in Python 2.3. Most recently it has been adopted as the 'canonical' MRO for Perl 6 classes, and the default MRO for Parrot objects as well. @@ -287,7 +287,7 @@ default MRO for Parrot objects as well. =head2 How does C3 work. C3 works by always preserving local precendence ordering. This essentially means that no class will -appear before any of it's subclasses. Take the classic diamond inheritence pattern for instance: +appear before any of its subclasses. Take the classic diamond inheritance pattern for instance: / \ @@ -384,14 +384,14 @@ This is an alias for L above. It is always useful to be able to re-dispatch your method call to the "next most applicable method". This module provides a pseudo package along the lines of C or C which will re-dispatch the -method along the C3 linearization. This is best show with an examples. +method along the C3 linearization. This is best shown with an example. # a classic diamond MI pattern ... - - / \ - - \ / - + # + # / \ + # + # \ / + # package A; use c3; @@ -402,7 +402,7 @@ method along the C3 linearization. This is best show with an examples. use c3; sub foo { 'B::foo => ' . (shift)->next::method() } - package B; + package C; use base 'A'; use c3; sub foo { 'C::foo => ' . (shift)->next::method() } @@ -418,7 +418,7 @@ A few things to note. First, we do not require you to add on the method name to call (this is unlike C and C which do require that). This helps to enforce the rule that you cannot dispatch to a method of a different name (this is how C behaves as well). -The next thing to keep in mind is that you will need to pass all arguments to C it can +The next thing to keep in mind is that you will need to pass all arguments to C. It can not automatically use the current C<@_>. If C cannot find a next method to re-dispatch the call to, it will throw an exception. @@ -445,22 +445,22 @@ But there are still caveats, so here goes ... =item Use of C. -The idea of C under multiple inheritence is ambigious, and generally not recomended anyway. -However, it's use in conjuntion with this module is very much not recommended, and in fact very +The idea of C under multiple inheritance is ambigious, and generally not recomended anyway. +However, its use in conjuntion with this module is very much not recommended, and in fact very discouraged. The recommended approach is to instead use the supplied C feature, see -more details on it's usage above. +more details on its usage above. =item Changing C<@ISA>. It is the author's opinion that changing C<@ISA> at runtime is pure insanity anyway. However, people do it, so I must caveat. Any changes to the C<@ISA> will not be reflected in the MRO calculated by this -module, and therefor probably won't even show up. If you do this, you will need to call C +module, and therefore probably won't even show up. If you do this, you will need to call C in order to recalulate B method dispatch tables. See the C documentation and an example in F for more information. =item Adding/deleting methods from class symbol tables. -This module calculates the MRO for each requested class by interogatting the symbol tables of said classes. +This module calculates the MRO for each requested class by interogating the symbol tables of said classes. So any symbol table manipulation which takes place after our INIT phase is run will not be reflected in the calculated MRO. Just as with changing the C<@ISA>, you will need to call C for any changes you make to take effect.