is ITM an element of the list LST?
Usage: member ITM LST proc member {itm lst} { if {-1 == [lsearch -exact $lst $itm]} {return 0} else {return 1}} addset – add an item to a set proc addset {itm lst} { if {! [member $itm $lst]} { lappend lst $itm } return $lst } wm_elts – Return triples of all WM elements matching pattern proc wm_elts {ob attr val} { output-strings-destination -push -append-to-result set wmemstr [wmem “($ob ^$attr $val)”] output-strings-destination -pop set def “” while {[scan $wmemstr “%\[^\n\]%\[ \t\n\]” wm_elt ws] > 0} { set ct [scan $wm_elt “(%d: %s %s %\[^)\])” time nob nattr nval] if {$ct > 0} { lappend def “$nob $nattr $nval” set len [string length $wm_elt] set len [expr $len + [string length $ws]] set wmemstr [string range $wmemstr $len end] } else { set wmemstr “” } } return $def } # Return all WM objects matching the specified ATTR / VAL # e.g., # all objects – allobs * * # all states – allobs superstate * # top state – allobs superstate nil proc allobs {attr val} { set obs “” foreach wm [wm_el