Skip to content

Commit b383726

Browse files
authored
Document handles(**)
Explains that you can pass a HyperWhatever to the `handles` method and describes how that's different from passing a Whatever.
1 parent eb0b0e8 commit b383726

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

doc/Language/objects.pod6

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -686,8 +686,14 @@ of the I«delegatee»'s methods as its own.
686686
In Raku, delegation is specified by applying the L«handles|/language/typesystem#trait_handles»
687687
trait to an attribute. The arguments provided to the trait specify the methods
688688
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.
691697
692698
=begin code
693699
class Book {

0 commit comments

Comments
 (0)