Skip to content

Commit

Permalink
add MONKEY example to Coercion Type
Browse files Browse the repository at this point in the history
  • Loading branch information
gfldex committed Dec 2, 2016
1 parent 8b78b8f commit bc67dc3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions doc/Type/Signature.pod6
Expand Up @@ -273,6 +273,12 @@ be omitted.
f '10', 10;
# OUTPUT«(Int)(Str)␤»
use MONKEY;
augment class Str { method Date() { Date.new(self) } };
sub foo(Date(Str) $d) { say $d.WHAT; say $d };
foo "2016-12-01";
# OUTPUT«Date.new(2016,11,1)␤»
=head2 X<Slurpy (A.K.A. Variadic) Parameters|parameter,*@;parameter,*%,slurpy argument (Signature)>
A function is X<variadic> if it can take a varying number of arguments; that is,
Expand Down

0 comments on commit bc67dc3

Please sign in to comment.