File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -686,8 +686,14 @@ of the I«delegatee»'s methods as its own.
686
686
In Raku, delegation is specified by applying the L « handles|/language/typesystem#trait_handles »
687
687
trait to an attribute. The arguments provided to the trait specify the methods
688
688
the object and the I « delegatee » attribute will have in common. Instead of a
689
- list of method names, a C < Pair > (for renaming), a list of C < Pairs > , a C < Regex >
690
- or a C < Whatever > can be provided.
689
+ list of method names, you can provide a C < Pair > (to rename; the key becomes the
690
+ new name), a C < Regex > (to handle every method with a matching name), a C < Whatever >
691
+ (to delegate all methods that the attribute L < can|type/Metamodel::ClassHOW#method_can >
692
+ call), or a C < HyperWhatever > (to delegate all method calls, even ones that will lead to
693
+ the attribute's L < FALLBACK|routine/FALLBACK > method). You can also provide a C < List > providing
694
+ any of those items to delegate multiple methods. Note that the C < Regex > , C < Whatever > , and
695
+ C < HyperWhatever > forms do not delegate any methods that the class has inherited (for example,
696
+ from C < Any > or C < Mu > ) but that explicitly naming the method does delegate it.
691
697
692
698
= begin code
693
699
class Book {
You can’t perform that action at this time.
0 commit comments