Version 1 of named parameters

Updated 2008-05-08 02:48:37 by CMcC

dict makes named parameters easy.

 proc example {a b args} {
   if {[llength $args] == 1} {
     set args [lindex $args 0] ;# work with unexpanded args
   }

   # establish defaults
   set args [dict merge {default value} $args]

   # use elements from dict
   fn [dict get $args parameter]


   # (dangerously) use args dict as variables
   dict with $args {}
 }

enter categories here