You vec approach is the current solution. I'm 95% sure you'll have to pay the O(n) once, but you'll be good to go after that.
Sean On Jan 1, 7:19 pm, Gabi <bugspy...@gmail.com> wrote: > What is the preferred way getting a vector back from sequence, after a > sequence producing operation (like sort)? Does using (vec..) on a > sequence that was a vector is costly? > > One (bad?) possibility is creating a new vector out of sequence: > > (vec (sort [1 2 3 4 5 6])) > > I am asking because I need random access (nth ..) to huge sorted > vectors - which are now actually huge sequences after the sort, with > horrible O(n) random access time -- 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