Ahh, this is the best one looking yet! :-) On Feb 18, 1:45 pm, Jeff Valk <jv-li...@tx.rr.com> wrote: > Here's another. > > (defn remove-at [v & idxs] > (vec (for [i (range (count v)) :when (not ((set idxs) i))] (v i)))) > > - Jeff >
And this one is definitely the fastest one: > On Wednesday 18 February 2009 12:07, Chouser wrote: > > > > > On Wed, Feb 18, 2009 at 12:30 PM, Telman Yusupov <use...@yusupov.com> wrote: > > > No prettier, but a bit faster: > > > (defn remove-at42 [coll & indexes] > > (let [iset (set indexes)] > > (loop [i (int 0) sq (seq coll) v []] > > (if-not sq > > v > > (recur (inc i) > > (next sq) > > (if (iset i) > > v > > (conj v (first sq)))))))) > > > --Chouser > > --~--~---------~--~----~------------~-------~--~----~ 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 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 -~----------~----~----~----~------~----~------~--~---