TABLE OF CONTENTS


::pwtk::lunique

SYNOPSIS

proc ::pwtk::lunique {list} {

PURPOSE

Remove duplicate elements from the list, while preserving the order or elements.

Taken from https://wiki.tcl-lang.org/page/Unique+Element+List (author: Wolf-Dieter Busch)

SOURCE

    set new {}
    foreach e $list {
        if {$e ni $new} {
            lappend new $e
        }
    }
    return $new
}