Changing value of atom vector using swap

2016-12-20 Thread 'Rickesh Bedia' via Clojure
I have (def data {:headers ["A" "B" "C" "D"] :rows [["1" "2" "3" "4"] ["5" "6" "7" "8"] ["9" "10" "11" "12"]]}) And I have a function (defn replace-value [struct] (clojure.walk/prewalk-replace {"3" "hello"} (struct :rows))) When I do (replace-value @data) > [["1" "2" "hello

Re: Changing value of atom vector using swap

2016-12-20 Thread Ghadi Shayban
swap! takes as its arguments the atom and the function to transition the state inside the atom. It implicitly calls the function on the state: (swap! data replace-value) It also can accept trailing arguments too... https://www.conj.io/store/v1/org.clojure/clojure/1.8.0/clj/clojure.core/swap%2

Re: [ANN] data.xml 0.2.0-alpha1

2016-12-20 Thread Francis Hitchens
Hi Herwig, I would like some help on how to use namespaces. I'm using the org.clojure/data.xml "0.1.0-beta3" and am a bit confused and can't find any good examples. My namespaced xml message has elements where the :tag is an javax.xml.namespace.QName object. Up to now I have been just handlin

unit tests on gen-class outcome

2016-12-20 Thread Jacek Grzebyta
Hi, I have a project which uses some java project. I made classes using gen-class. Than in unit test just wanted to test it (clojure.test enviro). If I run tests in emacs+cider they works. If I run test in the command line I have class not found exception: boot testing aot run-test task testing

Re: Changing value of atom vector using swap

2016-12-20 Thread Michael Blume
It doesn't look like data is actually an atom? Maybe that's just an error in your e-mail... On Tue, Dec 20, 2016 at 8:24 AM Ghadi Shayban wrote: > swap! takes as its arguments the atom and the function to transition the > state inside the atom. It implicitly calls the function on the state: > (

Re: [ANN] data.xml 0.2.0-alpha1

2016-12-20 Thread Herwig Hochleitner
Hi Francis, first off: if you can afford it, I'd recommend working with the 0.2.0 series, as the 0.1.0 namespace api is legacy. In the 0.2.0 series, the mapping of keyword prefix to xmlns is unique and fixed, so names are always parsed as keywords (though QName instances still are permitted for e