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

set ord [list -colour -weight -underline] 
set l [list -weight bold -colour red -underline 0]            
foreach {n v} $l { 
        set i [lsearch -exact $ord $n]   
        set q($i) $v              
}
set r {}
foreach i [lsort -integer [array names q]] {
        lappend r $q($i)
}
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] }