Your problem is the argument name args
which has a special meaning.
From the manual of proc:
If the last formal argument has the name args, then a call to the procedure may contain more actual arguments than the procedure has formal arguments. In this case, all of the actual arguments starting at the one that would be assigned to args are combined into a list (as if the list command had been used); this combined value is assigned to the local variable args.
So if you use any other name for the argument, it will work fine.
Example use for args
:
proc putargs args {
puts $args
}
# Call with more than one argument
putargs foo bar
# Use as command prefix for callbacks.
trace add execution glob {enter leave} {list putargs GLOB}