Fork me on GitHub
#clojure
<
2018-04-15
>
ttx13:04:05

Anyone here using yada for development? I could use some help.

orestis13:04:22

See also #yada

👍 8
elevi15:04:31

Hi 🙂 how can I collect data from a bulk of Go channels, I get Assert failed: <! used not in (go ...) for the code below. I know why I get it, I'm asking what is the best way to consume from all channels.

(->> state
         :pods
         (map #(go [(pd/id %) (<! (f/pod-metrics fleet %))]))
         (map <!)
         (into {}))

justinlee18:04:47

is there something like into but with an offset? I have a vector of elements and I get chunks of that data over the network, so I want to copy, say, 50 elements into the vector at a given offset

Alex Miller (Clojure team)18:04:58

No, and an array might be a better match

justinlee18:04:46

right. thanks. this makes me realize what i’m doing is a bad idea and i shouldn’t be doing it. 🙂

mfikes18:04:55

@justinlee The best I can think of to get close to the same as an array would be to start off with

(reduce-kv (fn [coll k v] (assoc coll (+ k 1) v)) [0 0 1 1] [4 5])
and then convert it to use transients, which it is amenable to