title: How to call a procedure with arguments from argument list
body: <p>This is Tcl 8.4.</p>
  
  <p>I'm trying to make a procedure that can do something common on any other procedure specified by the user.</p>
  
  <p>For example:</p>
  
  <pre><code>proc process_menu_item {command args {count 1}} {
      set inf     [expr {$count == -1 ? 1 : 0}]
      set end_str [expr {$count == -1 ? "inf" : $count}]
      set loop_cnt 0
  
      while {$inf || $count &gt; 0} {
          incr loop_cnt
          puts [format "------- %s -------" [bold "LOOP $loop_cnt of $end_str"]]
  
          $command $args
      }
      return
  }
  </code></pre>
  
  <p>This procedure, I hoped, will just execute the specified $command $count times. 
  The problem I run into is with passing the arguments.</p>
  
  <p>Let's assume I want to call a procedure like this:</p>
  
  <pre><code>proc example {{par_a {-1}} {par_b {-1}} {par_c 1}} {
      puts "All params: $par_a $par_b $par_c"
  }
  </code></pre>
  
  <p>How should I call <code>process_menu_item</code>? Is it even possible? I tried a string, a list, but eventually <code>par_a</code> gets a big list of all the arguments.</p>
  
  <p>Thank you.</p>