Call a function: Difference between revisions

→‎{{header|Perl 6}}: optional args don't look any different from required args
m (optional arguments and varargs may not be the same)
(→‎{{header|Perl 6}}: optional args don't look any different from required args)
Line 152:
1."$name"(2) # as method via dispatcher, symbolic
1 + 2 # as operator to infix:<+> function</lang>
 
Optional arguments don't look any different from normal arguments.
The optionality is all on the binding end.
 
Calling a function with a variable number of arguments (varargs):
Line 171 ⟶ 174:
on whether a signature accepts a list at that position in the argument list, but
describing that is not the purpose of this task. Suffice to say that we assume here that the
foo function is declared with a signature of the form (*@params). The calls above might be interpreted as having a single array argument if the signature indicates a normal parameter instead of a variadic one.
 
Calling a function with named arguments:
Anonymous user