Posted to tcl by aku at Mon Jan 28 23:30:34 GMT 2008view pretty

proc ::struct::set::Cleanup {A} {
    # unset A to avoid collisions
    if {[llength $A] < 2} {return $A}
    # We cannot use variables to avoid an explicit array. The set
    # elements may look like namespace vars (i.e. contain ::), and
    # such elements break that, cannot be proc-local variables.
    array set S {}
    foreach item $A {set S($item) .}
    return [array names S]

    #foreach [lindex [list $A [unset A]] 0] {.} {break}
    #return [info locals]