From: KATO K. <k.k...@gm...> - 2008-05-26 10:27:02
|
You know that Tcl interpreter doesn't ensure that dict key ordering. That is not matter for almost cases. But when we write test cases, how to compare between program result and booked value? Especially, it is difficult problem for multi rank dict. Thoughts? I wrote a proc, and replaced from [dict create $key_duplicated_dict]. (yaml.tcl) # remove duplications with saving key order proc ::yaml::_remove_duplication {dict} { array set tmp $dict array set tmp2 {} foreach {key nop} $dict { if [info exists tmp2($key)] continue lappend result $key $tmp($key) set tmp2($key) 1 } return $result } |