Variadic function: Difference between revisions
Content added Content deleted
Thundergnat (talk | contribs) (Rename Perl 6 -> Raku, alphabetize, minor clean-up) |
SqrtNegInf (talk | contribs) m (→{{header|Raku}}: Fix comment: Perl 6 --> Raku) |
||
Line 2,207: | Line 2,207: | ||
order: knock at the door</pre> |
order: knock at the door</pre> |
||
Raku also supports slurpy arrays and hashes, which are formal parameters that consume extra positional and keyword arguments like <code>@_</code> and <code>%_</code>. You can make a parameter slurpy with the <code>*</code> twigil. This implementation of <code>&foo</code> works just like the last: |
|||
<lang perl6>sub foo (*@positional, *%named) { |
<lang perl6>sub foo (*@positional, *%named) { |