This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-07-23
Channels
- # admin-announcements (3)
- # beginners (35)
- # boot (87)
- # cider (84)
- # cljs-dev (6)
- # clojure (70)
- # clojure-austin (3)
- # clojure-italy (11)
- # clojure-japan (6)
- # clojure-korea (16)
- # clojure-russia (87)
- # clojurebridge (1)
- # clojurescript (122)
- # core-async (112)
- # cursive (2)
- # datomic (46)
- # editors (6)
- # jobs (2)
- # ldnclj (8)
- # re-frame (1)
- # reagent (1)
I need to use a particular branch of a library that is currently on clojars (clj-rethinkdb in this case). How should I go about including this branch of a library as a dependency in my project? Do I need to compile it from source, which raises questions about git submodules and where to put it. I presume I can add it to my local maven repo somehow, but I have never done this before.
clone the git project, switch to the branch, lein install
. match the project.clj version in your code. you’re done
lein install will place a compiled jar for the project you’re in into your local maven repo
which is where lein looks for deps before downloading them from e.g. clojars
In condp
, how to specify result-fn for the else clause? This causes IllegalArgumentException
(condp #(%1 %2) {:c 5}
:a :>> inc
:b :>> dec
:>> #(* 5 %))
@tap: What do you expect to be returned from that function? (* 5 {:c 5} )
? If that’s the case, I don’t think it makes sense to use the result function, but rather just a separate function call the way you would normally use else
. For example
(let [parameter {:c 5}]
(condp #(%1 %2) parameter
:a :>> inc
:b :>> dec
(keys parameter))) ;; Used this as the original doesn’t work
The main issue is that result-fn
gets applied to the result of the predicate, and in this case you do not have a result of the predicate, because you do not want to give it 2 arguments
thanks @surreal.analysis. I’m doing it that way as well.
What's the shortest way to turn {:cheque "Cheque", :savings "Savings"}
into [{:id :cheque :label "Cheque"} {:id :savings :label "Savings]
?
Right now I have, (map (fn [[k v]] {:id k :label v} my-map)
, but it feels like I could use a zipmap or something to make it even tighter.
nothing wrong with what you have
ok, thx
I have a lein question. If I want to include a .jar into a project do I have to setup a local maven repo? Or is there some other way?
@kamn: I typically use lein localrepo, which does interact with the local maven repo
https://github.com/kumarshantanu/lein-localrepo#install-artifacts-to-local-maven-repository
But, I believe you can also use :resource-paths [“path/to/jars/“]
based on the bottom of this: https://github.com/technomancy/leiningen/issues/1063
@surreal.analysis: Thanks for the feedback!
I will have to play with the resource path option. I was just setting up a cljsjs package and wanted to tested out. Seems like a good option
yes, I think we had a related conversation in another channel recently (that I can't find because search limits)
my recommendation is: - for artifacts YOU generate (e.g. in other projects) use a local repo - for unpublished third-party things you depend on, :resource-paths is ok, when a local repo doesn't make sense
my current project has both: two unpublished 3rd-party jars, and 2GB worth of parser models and such
the jars are in a local repo, and the models are in a separate directory pulled in via :resource-paths
That leads me to another question but lets say I have reagent and my-proj. I want to change functionality in the regeant project and test it in my-proj
hmm I thought I remember reading something about using libs folder path and symlinking once but that might of been for lein 1.x not lein 2.x
there are ways you could force it to work, but the likelihood of it ending in tears down the road (under pressure, usually) is very high.
@curtosis: There is the checkouts folder feature I was thinking about. https://github.com/technomancy/leiningen/blob/master/doc/TUTORIAL.md#checkout-dependencies