I wanted to create a union of the keys from two maps.

When I write 
(clojure.set/union (keys {:a 1 :b 2 :c 3}) (keys {:a 1 :b 2 :c 3}))
I get a result of (:b :c :a :a :c :b).
When I write (set (clojure.set/union (keys {:a 1 :b 2 :c 3}) (keys {:a 1 :b 
2 :c 3})))
the result is #{:a :c :b}.

The document of clojure.set/union describes that the function "Return a set 
that is the union of the input sets".
As it seems the function keys does not return a set and so the returning 
result is not a set too. Correct?
And that this is the reason, that the keys are duplicated in the returning 
"list".

I wonder know is this is a bug or not. And what the normal behaviour of the 
function should be in this case?
Should it throw an Exception, because the passed parameters are not sets, 
should it return a set, even if the passed parameters are no sets or should 
the desciption of the function should be changed to express that a list 
(with eeventually duplicated entries) is returend, if the passed parameters 
are lists? 

-- 
-- 
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
--- 
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 clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to