Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
improve capture parameters
  • Loading branch information
gfldex committed Jun 17, 2016
1 parent 71c3efb commit 1ad7597
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions doc/Type/Signature.pod
Expand Up @@ -401,6 +401,13 @@ indicate that the routine's L<C<multi> definitions|multi> can have any L<type
constraints|#Type_Constraints>. See L<proto|/language/functions#proto> for an
example.
If bound to a variable arguments can be forwarded as a whole using the slip operator C<|>.
sub a(Int $i, Str $s) { say $i.WHAT, $s.WHAT }
sub b(|c) { say c.WHAT; a(|c) }
b(42, "answer");
# OUTPUT«(Capture)␤(Int)(Str)␤»
=head2 X<Parameter Traits and Modifiers|trait,is copy;trait,is rw>
By default, parameters are bound to their argument and marked as
Expand Down

0 comments on commit 1ad7597

Please sign in to comment.