This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # admin-announcements (20)
- # beginners (8)
- # boot (90)
- # cider (19)
- # clojure (31)
- # clojure-czech (2)
- # clojure-italy (8)
- # clojure-japan (6)
- # clojure-russia (9)
- # clojurescript (165)
- # clojurex (3)
- # cursive (2)
- # events (3)
- # hoplon (2)
- # ldnclj (3)
- # luminus (2)
- # melbourne (2)
- # off-topic (8)
- # onyx (5)
- # reagent (2)
- # testing (2)
Hi all… I’m thinking about using lein checkout dependencies for some code that will be shared across maybe three Clojure projects and one ClojureScript project… https://github.com/technomancy/leiningen/blob/stable/doc/TUTORIAL.md#checkout-dependencies
Just curious if anyone has done this and can give me a heads-up about things to watch out for
@timgilbert: i've used checkout deps with clj and cljs projects... with cljs i did end up putting the checkouts/x/src paths onto src paths for some reason... figwheel reloading iirc
ghadi: should IReduceInit & co be considered clojure internals or do you really think it's safe to use in libraries?
Does anybody know what to do in this case? I thought the type at the top will be enough. Do I have to annotate Enlive's
:no-check to force it?
although depending on use, you want to consider extending CollReduce instead
it's for a "recordset" instance and the way it's handled when used with sequence fns or reduce (lazy vs non lazy, efficiency etc)
it's similar to https://github.com/ghadishayban/squee/blob/master/src/squee/impl/resultset.clj#L49-L82 as well
seems like I could have used iter-reduce, but the iter version in the lib I wrap is slighlty less efficient (some duplication between .hasNext and .next
I know about https://github.com/clojure/clojure/blob/master/src/clj/clojure/core/protocols.clj but IReduceInit is a bit lacking docs (even something minimal)
no, it's not doc'ed anywhere that I know of. maybe it's time to write a blog about it :)
someone did one related a while ago http://insideclojure.org/2015/01/18/reducible-generators/ :]
mpenet: thanks. I think during the 1.7 dev cycle there was a question about IReduceInit vs CollReduce, but now I'm solidly in favor of IReduceInit
It's a better interface (only one method, requires init value). The downside is no IReduceInit on clojure < 1.7.
Finally, after much deliberation, I've pushed out tools.namespace "0.3.0-alpha1" https://groups.google.com/d/topic/clojure/FQMNZgCfS54/discussion
Can someone explain to me why the (map ...) part doesn't get swap!-ed in?
(let [out (atom )] (swap! out conj "I appear in @out") (map #(swap! out conj %) ["I don't!"]) @out) ;; ["I appear in @out"]
Try wrapping the (map) call with (doall) or (take 1). It's about lazy evaluation. You can also use mapv which is not lazy.