[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

checking set intersection

This page is part of the web mail archives of SRFI 113 from before July 7th, 2015. The new archives for SRFI 113 contain all messages, not just those from before July 7th, 2015.

I've had uses for testing whether two sets
intersect without needing the actual
intersection, so I think the following would
be useful:

(define (set-intersects? a b)
  (positive? (set-size (set-intersection a b))))

though it could be implemented much
more efficiently.

I was originally going to write this as

  (not (set-empty? ...))

but realized there was no such predicate.
We might want to include that as well.