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

  1. proc ::struct::set::Cleanup {A} {
  2. # unset A to avoid collisions
  3. if {[llength $A] < 2} {return $A}
  4. # We cannot use variables to avoid an explicit array. The set
  5. # elements may look like namespace vars (i.e. contain ::), and
  6. # such elements break that, cannot be proc-local variables.
  7. array set S {}
  8. foreach item $A {set S($item) .}
  9. return [array names S]
  10.  
  11. #foreach [lindex [list $A [unset A]] 0] {.} {break}
  12. #return [info locals]
  13. }