Skip to content

Add ordered set operations? #70

Open
@mars0i

Description

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"):

(defn multi-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.)

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions