Skip to content

Commit

Permalink
More formal conjectural mention of typed slurpies.
Browse files Browse the repository at this point in the history
And change example that just happened to use them without any notes
on their semantics.
  • Loading branch information
jnthn committed Oct 27, 2015
1 parent 34443f6 commit a99182a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions S06-routines.pod
Expand Up @@ -1151,6 +1151,9 @@ so you can refer to it within the body.
# %flag has elements (flag => (a => 1)) and (data => [1,2,3])
# @data has nothing

[Conjecture: a future Perl 6 version will allow typed slurpy parametrs, which
will validate the types of the passed arguments.]

=head2 Slurpy block

It's also possible to declare a slurpy block: C<*&block>. It slurps
Expand Down Expand Up @@ -1650,11 +1653,11 @@ lexically scoped subroutine:
The closure parameter can have its own signature in a type specification written
with C<:(...)>:

sub limited_Dog_grep ($count, &block:(Dog), Dog *@list) {...}
sub limited_Dog_grep ($count, &block:(Dog), *@list) {...}

and even a return type:

sub limited_Dog_grep ($count, &block:(Dog --> Bool), Dog *@list) {...}
sub limited_Dog_grep ($count, &block:(Dog --> Bool), *@list) {...}

When an argument is passed to a closure parameter that has this kind of
signature, the argument must be a C<Code> object with a compatible
Expand Down

0 comments on commit a99182a

Please sign in to comment.