Skip to content

Commit

Permalink
[S06] remove fossil
Browse files Browse the repository at this point in the history
We no longer map named arguments to positional parameters.
  • Loading branch information
Carl Masak committed May 18, 2014
1 parent 94cb8d8 commit 25eb879
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions S06-routines.pod
Expand Up @@ -977,20 +977,7 @@ though that's already the default for positional parameters:

sub numcmp ($x!, $y!) { return $x <=> $y }

The corresponding arguments are evaluated in item context and may be
passed positionally or by name. To pass an argument by name,
specify it as a pair: C<< I<parameter_name> => I<argument_value> >>.

$comparison = numcmp(2,7);
$comparison = numcmp(x=>2, y=>7);
$comparison = numcmp(y=>7, x=>2);

Pairs may also be passed in adverbial pair notation:

$comparison = numcmp(:x(2), :y(7));
$comparison = numcmp(:y(7), :x(2));

Passing the wrong number of required arguments to a normal subroutine
Not passing all of the required arguments to a normal subroutine
is a fatal error. Passing a named argument that cannot be bound to a normal
subroutine is also a fatal error. (Methods are different.)

Expand Down

0 comments on commit 25eb879

Please sign in to comment.