I'm must be missing something obvious for the [s1 s2] case of union:

Is it only that you've measured (conj s1 s2) to be faster when s2 is
the smallest ?

(defn un
       ....
        ([s1 s2]
                (reduce conj s1 s2))
       ... )

user=> (def a #{1 2 3})
user=> (def b #{4 5 6 7})
user=> (def A #{:paul :georges :john})
user=> (def B #{:mark :mary})

user=> (un a b)
#{1 2 3 4 5 6 7}
user=> (un b a)
#{1 2 3 4 5 6 7}
user=> (un a B)
#{1 2 3 :mary :mark}
user=> (un B a)
#{1 2 3 :mary :mark}
user=> (un A B)
#{:paul :mary :john :mark :georges}
user=> (un B A)
#{:paul :mary :john :mark :georges}
user=>

???

--
JFB
--~--~---------~--~----~------------~-------~--~----~
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
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