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

checking set intersection



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.

-- 
Alex