Skip to content

Commit 38e07c8

Browse files
committed
Adds sigilless slurpy, closes #2675
1 parent 2a70459 commit 38e07c8

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

doc/Type/Signature.pod6

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -637,6 +637,17 @@ each argument to those Scalars. If the original argument also had an
637637
intermediary Scalar it is bypassed during this process, and is not available
638638
inside the called function.
639639
640+
Sigilled parameters will always impose a context on the collected arguments.
641+
Sigilless parameters can also be used slurpily, preceded by a + sign, to
642+
work with whatever initial type they started with:
643+
644+
=for code
645+
sub zipi( +zape ) {
646+
zape.^name => zape
647+
};
648+
say zipi( "Hey "); # OUTPUT: «List => (Hey )␤»
649+
say zipi( 1...* ); # OUTPUT: «Seq => (...)␤»
650+
640651
Slurpy parameters have special behaviors when combined with some
641652
L<traits and modifiers|#Parameter_Traits_and_Modifiers>,
642653
as described in

0 commit comments

Comments
 (0)