On Tuesday, August 25, 2015 at 1:06:30 PM UTC-4, Hussein B. wrote:
>
> Hi,
>
> For a vector like [A B C D E], how to remove an element to a specific 
> location? For example [A D B C E] ?
>

How about (assoc (assoc v j (v i)) i (v j)), once you have the indices i 
and j of two elements you wish to swap?

If you want to actually slide all the other elements to the right, though, 
then vectors are not well designed for that. In fact doing such a move with 
arrays, vectors, *or* lists will take time linear in whichever index is 
larger, the position to move from or the position to move to.

-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to