next up previous index
Next: Local and Global Up: Procedures Previous: Default Arguments

Variable Number of Arguments

  If the last argument of a procedure is the word args, the procedure may be called with additional arguments which will be stored in args:

% proc out {a args} {
    puts $a
    foreach i $args {
        puts -nonewline $i
    }
    puts {}
}
% out 5
5

% out 5 7 9 10
5
7910


Micha Meier
Tue Jul 2 09:49:39 MET DST 1996