Next: , Previous: , Up: srfi sets-and-bags   [Index]


2.37.6 The whole set

Function: set-size set
Function: beg-size bag

Return the number of elements in set or bag as an exact integer.

Function: set-find predicate set
Function: set-find predicate set failure
Function: bag-find predicate bag
Function: bag-find predicate bag failure

Return an arbitrarily chosen element of set or bag that satisfies predicate, or the result of invoking failure with no arguments if there is none.

As Vicare extension: when failure is missing, it defaults to sentinel.

Function: set-count predicate set
Function: bag-count predicate bag

Return an an exact integer representing the number of elements of set or bag that satisfy predicate.

Function: set-any? predicate set
Function: bag-any? predicate bag

Return #t if at least one element of set or bag satisfies predicate; otherwise return #f. If the set or bag is empty: the return value is #f.

NOTE This differs from the SRFI-1 analogue because it does not return an element of the set.

Function: set-every? predicate set
Function: bag-every? predicate bag

Return #t if every element of set or bag satisfies predicate; otherwise return #f. If the set or bag is empty: the return value is #t.

NOTE This differs from the SRFI-1 analogue because it does not return an element of the set.