nub xs
removes duplicates from xs
Source code:
set result {} foreach x $xs { if { [not_elem_p $x $result] } { lappend result $x } } return $result