Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix example in 4.8 Unpacking
  • Loading branch information
usev6 committed Dec 7, 2014
1 parent 0f87d07 commit c27d240
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/subs-n-sigs.pod
Expand Up @@ -1097,13 +1097,15 @@ that with ordinary slicing access, or you can use signature binding:
my $first = @a.shift;
# TODO: either explain junctions, or find a
# concise way to write without them
return $first >= all(@a);
# TODO: also explain the use of 'so' to cap the junction
# http://perl6advent.wordpress.com/2014/12/03/day-3-cap-your-junctions/
return so $first >= all(@a);
}

# same thing:
sub first-is-largest(@a) {
my :($first, *@rest) := \(|@a)
return $first >= all(@rest);
my ($first, *@rest) := @a;
return so $first >= all(@rest);
}

=end programlisting
Expand All @@ -1114,7 +1116,7 @@ main signature of a subroutine, you get tremendous power:
=begin programlisting

sub first-is-largest([$first, *@rest]) {
return $first >= all(@rest);
return so $first >= all(@rest);
}

=end programlisting
Expand Down

0 comments on commit c27d240

Please sign in to comment.