-   Linux - Software (
-   -   uniq in tcl/tk (

liguorir 05-16-2004 03:39 PM

uniq in tcl/tk
Does Tcl have a 'uniq' equivalent?

If you what is it?

Please advise.

liguorir 05-20-2004 11:34 PM

Tcl's luniq
I found it:

List with duplicates removed, and keeping the original order:

proc luniq {L} {
# removes duplicates without sorting the input list
set t {}
foreach i $L {if {[lsearch -exact $t $i]==-1} {lappend t $i}}
return $t
} ;# RS

All times are GMT -5. The time now is 03:46 PM.