Posted to tcl by Stu at Mon Jul 14 14:47:57 GMT 2008view raw

  1. set ord [list -colour -weight -underline]
  2. set l [list -weight bold -colour red -underline 0]
  3. foreach {n v} $l {
  4. set i [lsearch -exact $ord $n]
  5. set q($i) $v
  6. }
  7. set r {}
  8. foreach i [lsort -integer [array names q]] {
  9. lappend r $q($i)
  10. }
  11. puts $r

Comments

Posted by nem at Mon Jul 14 14:53:51 GMT 2008 [text] [code]

set ord {-colour -weight -underline} foreach op $ord { lappend opts [dict get $l $op] }