(= (seq v) (distinct v)) will short-circuit as soon as an inequality is found.
On Sep 3, 12:47 pm, Meikel Brandmeyer <m...@kotka.de> wrote: > Hi, > > Am 03.09.2011 um 19:30 schrieb Despite: > > > So, you want to make sure each value in the vector is unique? My > > first thought was to put them into a set, then see if the set was > > equal to the vector, but clojure's equality doesn't allow for that. > > And if you put the set back into a vector, you've changed the order. > > You can check (= (count v) (count (set v))) whether there are no duplicates. > > Sincerley > Meikel -- 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