You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since, as noted in the ordered-set docstring, clojure.set/union and other operations in clojure.set may reorder elements for efficiency, perhaps it would be useful for ordered to include (less efficient?) set operations that preserve order. For example, I needed to preserve order with union, so I am using this definition (which might also be called "union"):
(defnmulti-conj"Successively conj each element of ys onto xs."
[xs ys]
(reduce (fn [newxs y] (conj newxs y))
xs ys))
(I need it for two-element sets on the right, so efficiency shouldn't be an issue in my case.)
The text was updated successfully, but these errors were encountered:
Since, as noted in the
ordered-set
docstring,clojure.set/union
and other operations inclojure.set
may reorder elements for efficiency, perhaps it would be useful forordered
to include (less efficient?) set operations that preserve order. For example, I needed to preserve order with union, so I am using this definition (which might also be called "union"):(I need it for two-element sets on the right, so efficiency shouldn't be an issue in my case.)
The text was updated successfully, but these errors were encountered: