Swap Two Items in a Vector
> (assoc [5 6 7 8] 1 9)
; [5 9 7 8]> (assoc [5 6 7 8] 1 2 2 4)
; [5 2 4 8](defn swap
[items i j]
(assoc items i (items j) j (items i)))Last updated
> (assoc [5 6 7 8] 1 9)
; [5 9 7 8]> (assoc [5 6 7 8] 1 2 2 4)
; [5 2 4 8](defn swap
[items i j]
(assoc items i (items j) j (items i)))Last updated