@@ -256,7 +256,7 @@ against undefined values within the C<where> clause.
256
256
257
257
= head3 Constraining slurpy arguments
258
258
259
- L < Slurpy arguments|#Slurpy_(A.K.A._variadic)_parameters > can not have type
259
+ L < Slurpy arguments|#Slurpy_parameters > can not have type
260
260
constraints. A C < where > -clause in conjunction with a L < Junction|/type/Junction >
261
261
can be used to that effect.
262
262
@@ -648,11 +648,16 @@ directly apply string methods, such as the number of characters.
648
648
X < |parameter,*@ >
649
649
X < |parameter,*% >
650
650
X < |slurpy argument >
651
- = head2 Variadic parameters
651
+ = head2 Slurpy parameters
652
652
653
653
A function is X < variadic > if it can take a varying number of arguments; that is,
654
- its arity is not fixed. Therefore, optional, named, and slurpy parameters
655
- make routines that use them I < variadic > . An array or hash parameter can be
654
+ its arity is not fixed. Therefore,
655
+ L < optional|https://docs.raku.org/type/Signature#index-entry-optional_argument > ,
656
+ named, and slurpy parameters
657
+ make routines that use them I < variadic > , and by extension are called variadic
658
+ arguments. Here we will focus on slurpy parameters, or simply I < slurpies > .
659
+
660
+ An array or hash parameter can be
656
661
marked as I < slurpy > by leading single (*) or double asterisk (**) or a
657
662
leading plus (+). A slurpy parameter can bind to an arbitrary number of
658
663
arguments (zero or more), and it will result in a type that is compatible
@@ -695,7 +700,8 @@ say combined-slurpy(one => 1, two => 2, 3, 4, five => 5, 6);
695
700
# OUTPUT: «{array => [3 4 6], hash => {five => 5, one => 1, two => 2}}»
696
701
= end code
697
702
698
- Note that positional parameters aren't allowed after slurpy parameters:
703
+ Note that positional parameters aren't allowed after slurpy (or, in
704
+ fact, after any type of variadic) parameters:
699
705
700
706
= begin code :skip-test<compile time error>
701
707
:(*@args, $last);
0 commit comments