LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   uniq in tcl/tk (https://www.linuxquestions.org/questions/linux-software-2/uniq-in-tcl-tk-182131/)

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:

http://wiki.tcl.tk/526

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.