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

*To*: Alex Shinn <alexshinn@xxxxxxxxx>*Subject*: Re: checking set intersection*From*: John Cowan <cowan@xxxxxxxxxxxxxxxx>*Date*: Tue, 24 Dec 2013 22:20:44 -0500*Cc*: srfi-113@xxxxxxxxxxxxxxxxx*Delivered-to*: srfi-113@xxxxxxxxxxxxxxxxx*In-reply-to*: <CAMMPzYOPJEbsSe6vdQZa1=5Lu6oKoPtSxzdWV_KaN-HpikyPwA@mail.gmail.com>*References*: <CAMMPzYOPJEbsSe6vdQZa1=5Lu6oKoPtSxzdWV_KaN-HpikyPwA@mail.gmail.com>*Sender*: John Cowan <cowan@xxxxxxxx>*User-agent*: Mutt/1.5.20 (2009-06-14)

Alex Shinn scripsit: > (define (set-intersects? a b) > (positive? (set-size (set-intersection a b)))) > > though it could be implemented much > more efficiently. Added. > 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. I suppose we could include it for completeness, but there isn't a natural recursion on sets the way there is on lists; not even a way to say "remove an arbitrary member of the set and return it". So `set-empty?` isn't really a base case. Still, I'll include it. -- John Cowan cowan@xxxxxxxx http://ccil.org/~cowan And now here I was, in a country where a right to say how the country should be governed was restricted to six persons in each thousand of its population. For the nine hundred and ninety-four to express dissatisfaction with the regnant system and propose to change it, would have made the whole six shudder as one man, it would have been so disloyal, so dishonorable, such putrid black treason. --Mark Twain's Connecticut Yankee

**References**:**checking set intersection***From:*Alex Shinn

- Prev by Date:
**Re: enumeration set case syntax** - Next by Date:
**Re: checking set intersection** - Previous by thread:
**Re: checking set intersection** - Next by thread:
**New version of SRFI 113** - Index(es):