Skip to content

Commit

Permalink
doc FALLBACK
Browse files Browse the repository at this point in the history
  • Loading branch information
gfldex committed Jul 30, 2016
1 parent 7b9e2ea commit 2b7bed6
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions doc/Language/typesystem.pod6
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,22 @@ TODO
=head3 Methods
=head4 Fallback method
X<|FALLBACK (method)>
A method with the special name C<FALLBACK> will be called when other means to
resolve the name produce no result. The first agument holds the name and all
following arguments are forwarded from the original call. Multi methods and
subsignatures are supported.
class Magic {
method FALLBACK ($name, |c(Int, Str)) {
put "$name called with parameters {c.perl}" }
};
Magic.new.simsalabim(42, "answer");
# OUTPUT: «simsalabim called with parameters ⌈\(42, "answer")⌋␤»
=head4 Reserved Method Names
X<|WHAT (reserved method)>X<|WHO (reserved method)>X<|HOW (reserved method)>X<|VAR (reserved method)>
Expand Down

0 comments on commit 2b7bed6

Please sign in to comment.