Purpose: Definition and discussion of set functionality, especially the function to check for membership of elements.
Back to the Chart of proposed set functionality.
::setops::contains set element
2 Arguments:
Return value:
Implementation:
proc ::setops::contains {set element} { expr {[lsearch -exact $set $element] >= 0} #expr {[lsearch -exact $set $element] < 0 ? 0 : 1} }
C implementation using a hash table:
-- AK