proc myproc args { ... }
proc myproc {args} { ... } ;# equivalent
If the special parameter name args
is the last item in the argument list, it receives a list of all arguments at that point in the command line. If there are none, the list is empty.
There can be arguments, including optional ones, before args
:
proc myproc {alpha {beta {}} args} { ... }
This procedure will accept one or more arguments. The first two, if present, will be consumed by alpha
and beta
: the list of the rest of the arguments will be assigned to args
.