Re: clojure.lang.PersistentVector cannot be cast to clojure.lang.IAtom

2018-04-03 Thread Timothy Baldridge
I think you're calling `deref` on the collection before passing it in? What it's saying is that `swap!` expects an atom and you handed it a vector. So either pass in the atom, or return a updated collection by replacing the call to `swap!` and the `doseq` with `(into collection selecteds)` On Tue,

Re: clojure.lang.PersistentVector cannot be cast to clojure.lang.IAtom

2018-04-03 Thread Renata Soares
Thanks for the tips! Em terça-feira, 3 de abril de 2018 20:39:25 UTC-3, Base escreveu: > > Swap requires an atom as an input. > > https://clojuredocs.org/clojure.core/swap! > > If you are trying to perform swap! on a collection that was just read from > json/read-str then it is probably not an a

Re: clojure.lang.PersistentVector cannot be cast to clojure.lang.IAtom

2018-04-03 Thread Renata Soares
I was passing as a parameter with @ before... it worked when i passed just the atom name. Thanks. Em terça-feira, 3 de abril de 2018 20:36:58 UTC-3, André escreveu: > > collection probably isn’t an atom. Do you have a fully working snippet? > > On 04/03/2018 08:24 PM, Renata Soares wrote: > > Goo

Re: clojure.lang.PersistentVector cannot be cast to clojure.lang.IAtom

2018-04-03 Thread Base
Swap requires an atom as an input. https://clojuredocs.org/clojure.core/swap! If you are trying to perform swap! on a collection that was just read from json/read-str then it is probably not an atom, and you would need to convert it to an atom before doing this. However, generally there are

Re: clojure.lang.PersistentVector cannot be cast to clojure.lang.IAtom

2018-04-03 Thread 'André' via Clojure
|collection| probably isn’t an atom. Do you have a fully working snippet? On 04/03/2018 08:24 PM, Renata Soares wrote: > Good Night, > > I have this function: > > (defn treat-requests [key-request collection] > (let [selecteds (filter #((keyword key-request) %) input)] > (doseq [item selecteds] >