File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -219,4 +219,26 @@ Returns C<True> if the invocant contains at least one key/value pair.
219
219
my $m = Map.new('a' => 2, 'b' => 17);
220
220
say $m.Bool; # True
221
221
222
+ = head2 method Capture
223
+
224
+ Defined as:
225
+
226
+ method Capture(Map:D:) returns Capture:D
227
+
228
+ Usage:
229
+
230
+ MAP.Capture
231
+
232
+ Returns a L < Capture|/type/Capture > where each key, if any, has been converted
233
+ to a named argument with the same value as it had in the original C < Map > .
234
+ The returned C < Capture > will not contain any positional arguments.
235
+
236
+ my $map = Map.new('a' => 2, 'b' => 17);
237
+ my $capture = $map.Capture;
238
+ my-sub(|$capture); # 2, 17
239
+
240
+ sub my-sub(:$a, :$b) {
241
+ say "$a, $b"
242
+ }
243
+
222
244
= end pod
You can’t perform that action at this time.
0 commit comments