File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -138,6 +138,17 @@ The first of those can be shortened to
138
138
i.e., you can use a literal directly as a type and value constraint
139
139
on an anonymous parameter.
140
140
141
+ Any argument in a C < Signature > is declared in a C < where > -clause that is
142
+ following that argument. Therefor, the C < where > -clause of the last argument got
143
+ access to all arguments of a signature that are not part of a sub-signature.
144
+ For sub-signature place the C < where > -clause inside the sub-signature.
145
+
146
+ sub one-of-them(:$a, :$b, :$c where { $a.defined ^^ $b.defined ^^ $c.defined } ) {
147
+ $a // $b // $c
148
+ };
149
+ say one-of-them(c=>42);
150
+ # OUTPUT « 42 »
151
+
141
152
= head3 Constraining Slurpy Arguments
142
153
143
154
L < Slurpy arguments|Slurpy_(A.K.A._Variadic)_Parameters > can not have type
You can’t perform that action at this time.
0 commit comments