Why shouldn't it give '(3 3 3)? It looks like you've introduced a
fairly arbitrary distinction between the first and second arguments to
a normally-symmetric function, intersect. And you would get the same
behavior by using one of my suggestions:

user> (filter (set [1 2 3 3 3]) [3 4 3 5])
(3 3)
user> (filter (set [3 4 3 5]) [1 2 3 3 3])
(3 3 3)

As a side note, Clojure rarely uses quoted lists for data structures:
vectors are easier for a number of reasons.

On Mar 13, 12:40 pm, Christian Schuhegger
<christian.schuheg...@gmail.com> wrote:
> I would like to keep duplicates, e.g. (intersect '( 1 2 3 3 3) '(3 4 3
> 5)) should give '(3 3). As I've said above, I've solved the issue for
> the moment by writing the required functions myself. I was just
> wondering if this functionality already exists somewhere in the
> clojure core/contrib space?

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to