method capture
Documentation for method capture
assembled from the following types:
class Parameter
From Parameter
(Parameter) method capture
Defined as:
method capture(Parameter:D: --> Bool:D)
Returns True
for parameters that capture the rest of the argument list into a single Capture object.
sub how_many_extra_positionals($!, |capture) { capture.elems.say } how_many_extra_positionals(0, 1, 2, 3); # OUTPUT: «3» say &how_many_extra_positionals.signature.params[1].capture; # OUTPUT: «True»
Like raw parameters, Capture
parameters do not force any context on the values bound to them, which is why their sigils are only used in declarations.