.cljrc

245 views
Skip to first unread message

Dave Tenny

unread,
Nov 25, 2013, 9:34:43 AM11/25/13
to clo...@googlegroups.com
With all my attention on trying to learn things about clojure, I've either missed or forgotten how do to a simple thing.

As I learn clojure I'm writing a few definitions that represent tools I like to use in development.

What is the simplest way to have those tools present in arbitrary clojure REPLs started with lein repl, emacs cider-jack-in, etc., without putting them in project.clj files for every lein project I'm working on ?

I just want to load some things into the user (or other default ns if my hypothetical .cljrc changes it) namespace and have it happen all the time, except when I'm doing release builds and such of a particular project.

Suggestions?


Moritz Ulrich

unread,
Nov 25, 2013, 10:01:12 AM11/25/13
to clo...@googlegroups.com
Leiningen profiles in ~/.lein/profiles.clj will be merged into the
current project.clj by leiningen. Also dumented in
https://github.com/technomancy/leiningen/blob/stable/doc/PROFILES.md
> --
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clo...@googlegroups.com
> Note that posts from new members are moderated - please be patient with your
> first post.
> To unsubscribe from this group, send email to
> clojure+u...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+u...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

dgrnbrg

unread,
Nov 25, 2013, 5:49:33 PM11/25/13
to clo...@googlegroups.com
Another great feature of Leiningen is the :injections key in project.clj. This lets you run arbitrary code on the Leiningen-managed JVM startup. I recommend this when using Spyscope, which is a debugging tool that only needs to be required before you can use it: https://github.com/dgrnbrg/spyscope#usage

Using :injections is a powerful to customize the default referred vars, as well.

Dave Tenny

unread,
Nov 27, 2013, 7:53:02 PM11/27/13
to clo...@googlegroups.com
Thanks, I seem to have accomplished what I need for now.  It was a bit frustrating to figure out exactly what I could do in profiles.clj.  For example, I can't find any documentation on :injections, which was key to evaluating some code once I'd specified libraries as dependencies.

Where are the full options of projects.clj and profiles.clj documented?  I can't find it anywhere in the git tree except by way of example in the sample project.clj, and the tutorial.


You received this message because you are subscribed to a topic in the Google Groups "Clojure" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/clojure/7NWXyQsG3WU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to clojure+u...@googlegroups.com.

Justin Smith

unread,
Nov 28, 2013, 1:39:58 PM11/28/13
to clo...@googlegroups.com
the leinengen project has an example project.clj

Dave Tenny

unread,
Nov 30, 2013, 10:29:27 AM11/30/13
to clo...@googlegroups.com
Thanks, that was one of the sample files I mentioned looking at, but it still didn't have the :injections stuff in it, and I was just wondering what else I was missing.  I have yet to find any real documentation on project and profiles [.clj] content other than examples, I was looking for the "reference guide" on these entities, but I suspect that's an exercise left for readers of the code at this time.
Reply all
Reply to author
Forward
0 new messages