Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
add example of type constraint on an optional argument
  • Loading branch information
tbrowder committed Sep 29, 2016
1 parent e5ddbfe commit 99a8666
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions doc/Type/Signature.pod6
Expand Up @@ -150,6 +150,12 @@ the C<where>-clause inside the sub-signature.
say one-of-them(c=>42);
# OUTPUT«42␤»
=head3 Constraining Optional Arguments
L<Optional arguments|Optional_and_Mandatory_Parameters> can have constraints, too:
sub bin2hex($bin, Int $len where {$len >= 0} = 0) { ... }
=head3 Constraining Slurpy Arguments
L<Slurpy arguments|Slurpy_(A.K.A._Variadic)_Parameters> can not have type
Expand Down

0 comments on commit 99a8666

Please sign in to comment.