I have created an atom, that contains a vector:
(def name-seq (atom ["A" 1]))
Within the swap! operation, I need to increment the number that's the last part of the vector. Here's what I am trying:
(swap! name-seq #(["A" (inc (last @%))]))
I get the following error: ClassCastException clojure.lang.PersistentVector cannot be cast to java.util.concurrent.Future clojure.core/deref-future (core.clj:2108)
What am I doing wrong here?
swap!sends thederef-ed atom to the given function. Thanks! - arnab