This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-08-14
Channels
- # 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
Specifically I’m wondering if it will mess up lein-cljsbuild or IntelliJ Cursive
…and also circleci build automation
@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 html/select
with :no-check
to force it?
mpenet: IReduceInit should be safe to use in libraries
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)
alexmiller: https://github.com/mpenet/alia/blob/feature/ireduce/src/qbits/alia/codec.clj#L153-L172
it's similar to https://github.com/ghadishayban/squee/blob/master/src/squee/impl/resultset.clj#L49-L82 as well
yeah, that's fine
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/ :]
That's mine :)
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.
@directedglaph: Also, use doseq for a non-lazy iteration for side-effects