Sets are stored in a very specific way that enables intersection to be fast
- proportional to the size of the smaller set.

Intersecting arbitrary sequences can't be done particularly efficiently.
If Clojure's intersection worked on sequences (perhaps by first converting
to sets behind the scenes), people would get in the habit of passing
sequences to intersection and would be surprised by the gross inefficiency
of their code.  Clojure forces you to choose the right data structure for
the task at hand.  If you need to do a lot of intersections, choose sets
from the start.

--Mark

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to