specter

itaied 2023-05-28T12:16:51.590239Z

Hi all, I want to accumulate a computation over a vector of maps and set its result to the map. For example:

{:vals [{:v 1} {:v 10} {:v 100} {:v 1000}]}
And assume the computation is :v divide by the total sum plus the previous computed result should be:
{:vals [{:v 1 :k (/ 1 1111)} {:v 10 :k (/ 11 1111)} {:v 100 :k (/ 111 1111)} {:v 1000 :k (/ 1111 1111)}]}
I'm looking for an alternative to https://ramdajs.com/docs/#mapAccum

rolt 2023-06-08T14:37:59.008879Z

clojure's macAccum is reductions

rolt 2023-06-08T14:38:09.819399Z

https://clojuredocs.org/clojure.core/reductions