This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-09-10
Channels
- # beginners (40)
- # boot (307)
- # boulder-clojurians (2)
- # carry (3)
- # cljs-dev (3)
- # cljsjs (16)
- # clojure (42)
- # clojure-greece (3)
- # clojure-russia (10)
- # clojure-uk (3)
- # clojurescript (116)
- # community-development (1)
- # component (5)
- # conf-proposals (2)
- # core-async (1)
- # crypto (2)
- # cursive (3)
- # devcards (1)
- # events (1)
- # hoplon (123)
- # om (28)
- # onyx (17)
- # pedestal (3)
- # proton (1)
- # re-frame (18)
- # reagent (26)
hey all how can I transform the contents of a channel?
(defn download-pom-for-dependency [dependency-url]
(println dependency-url)
(map #(identity %2) [(make-request dependency-url)]))
where
(defn make-request
[url]
(let [out (chan)]
(.get request #js {:url url}
(fn [error response body]
(put! out [error response body])))
out))
or you can use alts
and implement your own loop
https://clojuredocs.org/clojure.core.async/alts!
All the other slack groups I know use #general as the main channel, what would be the equivalent of #C03S1KBA2. I am not sure why #C03S1KBA2 was created in the first place...
I thought Clojure was to discuss Clojure, and ask questions. And ClojureScript is the same for ClojureScript.
General feels like a non useful channel, like people would talk about even non clojure related things
Speaking of discussing Clojure: What is the intent of metadata? I'm trying to figure out what I can reliably use it for. It can be added to symbols and collections, but not sequences, and I'm not sure if you can trust every collection and symbol function to keep and work properly with metadata.
Is it mostly a reader specific feature? Or can I reliably use it to a add meta dimensions to my collections?
Like imagine I had an algorithm that could be made more performant if it knew that a vector contained only odd numbers. So I want to start tagging my vectors with ^:odd when I know from their creation that they respect that property. Then my algorithm can transparently optimize when given an odd vector, and resort back to a slower implementation when the vector doesn't provide that info.
Metadata is "data about the data”. Semantically, it should be some kind of out-of-band info about what is in the data structure, but in practice it could be anything. Your example is a good example of “data about the data”, so it would be fine.
You’ve noticed that some things can’t have metadata (it needs to implement clojure.lang.IMeta
)
Well, maybe I'm wrong, but not everything that returns true for (sequence?) can have meta. Such as lazyseq
Ok, I guess I'm wrong. I thought since the doc on metadata said symbols and collections only, it didn't include sequence
it's complicated
especially with sequences
you mean, when you create something new from a collection with metadata, then will the new thing have the same metadata as the original thing?
My general experience has been that every time I tried to use metadata for out of band info, I ultimately decided that that metadata was really data and that it wasn’t worth the effort of retaining it
b/c it’s not as visible, it takes another level of awareness about what you’re doing that makes the code harder to maintain and communicate with others
I’d agree with this. The main benefit (for me) has been if I want to annotate data so I can cache some sort of work associated with it (where full memoization doesn’t quite fit)
but if my code breaks when metadata isn’t present, then it probably should have been data
Well… two things. First, since it will successfully calculate (just less efficiently) without the annotation, then this is a case where I would be comfortable with using metadata.
Second, if you really needed annotations, then: {:annotations {:odd true} :data [1 3 5 7 9]}
Regarding the bounded-count
core.async
discussion of yesterday, the slightly concerning thing is that the arguments have been backwards the entire time too. Captured in http://dev.clojure.org/jira/browse/ASYNC-175