On Wed, Feb 18, 2009 at 12:30 PM, Telman Yusupov <[email protected]> wrote:
>
> I'm not sure which version is more idiomatic, but the last one seems
> to give me the best performance out of all versions.
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---