File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change 26
26
27
27
= head3 Methods
28
28
29
+ = head4 Fallback method
30
+ X < |FALLBACK (method) >
31
+
32
+ A method with the special name C < FALLBACK > will be called when other means to
33
+ resolve the name produce no result. The first agument holds the name and all
34
+ following arguments are forwarded from the original call. Multi methods and
35
+ subsignatures are supported.
36
+
37
+ class Magic {
38
+ method FALLBACK ($name, |c(Int, Str)) {
39
+ put "$name called with parameters {c.perl}" }
40
+ };
41
+ Magic.new.simsalabim(42, "answer");
42
+
43
+ # OUTPUT: «simsalabim called with parameters ⌈\(42, "answer")⌋»
44
+
29
45
= head4 Reserved Method Names
30
46
31
47
X < |WHAT (reserved method) > X < |WHO (reserved method) > X < |HOW (reserved method) > X < |VAR (reserved method) >
You can’t perform that action at this time.
0 commit comments