Here's another.

(defn remove-at [v & idxs]
  (vec (for [i (range (count v)) :when (not ((set idxs) i))] (v i))))

- Jeff

On Wednesday 18 February 2009 12:07, Chouser  wrote:
> 
> On Wed, Feb 18, 2009 at 12:30 PM, Telman Yusupov <[email protected]> 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 [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
-~----------~----~----~----~------~----~------~--~---

Reply via email to