SetOps, Emptiness

Purpose: Definition and discussion of set functionality, especially the function to check a set for emptiness.

Back to the Chart of proposed set functionality.


::setops::empty set

Arguments:

  • Exactly one argument.
  • The argument represents the set to check.
  • The set is given by value, as tcl-list.

Result:

  • A boolean value. 0 = set is not empty, 1 = set is empty

Implementation:

 proc ::setops::empty {set} {
    expr {[llength $set] == 0}
 }

-- AK