Skip to content

Commit

Permalink
Document how is raw behaves with slurpy list parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaiepi committed Mar 23, 2020
1 parent 0588b51 commit 622a8c5
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions doc/Type/Parameter.pod6
Expand Up @@ -174,6 +174,17 @@ their sigil in code.
$x = 5;
}
When used with slurpy list parameters, the C<is raw> trait will cause the list
of arguments given to be packed into a C<List> instead of an C<Array>, which
prevents them from being containerized with C<Scalar>. This is the default
behavior when using C<+> with a sigilless parameter:
my @types is List = Mu, Any;
say -> *@l { @l }(@types)[0] =:= @types[0]; # OUTPUT: «False␤»
say -> +@l { @l }(@types)[0] =:= @types[0]; # OUTPUT: «False␤»
say -> +l { l }(@types)[0] =:= @types[0]; # OUTPUT: «True␤»
say -> *@l is raw { @l }(@types)[0] =:= @types[0]; # OUTPUT: «True␤»
=head2 method capture
Defined as:
Expand Down

0 comments on commit 622a8c5

Please sign in to comment.