Skip to content

Commit

Permalink
The colon means a named variable, *not* a Pair
Browse files Browse the repository at this point in the history
Specifying a Pair would be a Positional, and thus not match the signature.
  • Loading branch information
lizmat committed Jun 4, 2018
1 parent 8341bcf commit e0ca4a2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion doc/Language/5to6-nutshell.pod6
Expand Up @@ -622,7 +622,7 @@ sub get_the_loot( $loot, *%options ) { # The * means to slurp everything
get_the_loot( 'diamonds', quiet_level => 'very', quantity => 9 ); # Note: no curly braces in this API
# Perl 6, API changed to specify valid options
# The colon before the sigils means to expect a Pair,
# The colon before the sigils means to expect a named variable,
# with the key having the same name as the variable.
sub get_the_loot( $loot, :$quiet_level?, :$quantity = 1 ) {
# This version will check for unexpected arguments!
Expand Down

0 comments on commit e0ca4a2

Please sign in to comment.