Posted to tcl by kbk at Thu Sep 30 15:59:01 GMT 2010view raw

  1. proc myincr {dict key1 args} {
  2. upvar 1 $dict theDict
  3. dict update theDict $key1 theElement {
  4. if {[llength $args == 0]} {
  5. incr theElement
  6. } elseif {[llength $args == 1]} {
  7. incr theElement [lindex $args 0]
  8. } else {
  9. myincr theElement {*}$args
  10. }
  11. }
  12. }