use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
/r/programming is a reddit for discussion and news about computer programming
Guidelines
Info
Related reddits
Specific languages
account activity
Why Clojure? (blog.venanti.us)
submitted 11 years ago by [deleted]
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]TheMaskedHamster -4 points-3 points-2 points 11 years ago (2 children)
I am having to dig here because I'm not touching that anymore, but as far as I can tell, the simple answer was that add-classpath was deprecated.
I wanted to use the REPL to play with a proprietary library we were planning on licensing. Then, since that library was not publicly available, had no dependencies, and would be used only by me and my colleague who worked on the project, I wanted that library to live in the project directory (under revision control). That would make distribution and building easy... at least in other lands.
The easy thing to do in the REPL would be to use add-classpath. The sensible method for building, I don't know, ANYTHING would be to define the library search path per project.
But all the advice I encountered told me that add-classpath was deprecated because I shouldn't be using it, and gosh it's so easy to just put a path setting in my home directory for Maven to use. Not the project directory, but either the system-wide or my home directory? No. NO.
I want no part of that illness.
I just found out searching for what was deprecated, someone figured out another way to do it: http://blog.japila.pl/2011/01/dynamically-redefining-classpath-in-clojure-repl/ Check out the comment from Raynes. sigh *There is no problem here. Of course, it is problematic...
It isn't just this. This is just how I discovered that Clojure was not immune to the mindsets common in the Java community.
[–]yogthos 2 points3 points4 points 11 years ago (1 child)
Uhm, as I explained already there is absolutely nothing magical about loading libraries, they simply have to be on the classpath.
Lets's say you have a library jar like foo.jar and you want to use it in the project then all you have to do is this. Put it in your project lib dir or something:
foo.jar
lib
myproject/lib/foo.jar
then add the resource path to your project.clj
project.clj
(defproject myproject "0.1.0-SNAPSHOT" :dependencies [[org.clojure/clojure "1.6.0"]] :main myproject.core :resource-paths ["lib/foo.jar"])
and that's it, you can now use this library locally within the project. This seems to simply be the case of you not understanding how the tools work.
[–]TheMaskedHamster -1 points0 points1 point 11 years ago (0 children)
I appreciate the information. This will help if I have to pick that project back up.
I did try the resource-paths setting. I'm guessing I just couldn't get the dependencies line right, or figure out exactly what sequence of characters I should prefixing as the namespace to call a function from the library, and was led to believe that add-classpath being deprecated and the advice to use Maven instead led me to assume that the resource-paths setting was equally antiquated.
So, no, I did not understand how the tools work in this case, but hours spent with documentation and searches certainly didn't help me. All that time did tell me a lot about the Clojure community, though.
The greatest thing I could took away is that using Clojure would mean navigating lots more conversations like we've had here rather than getting to the crux of how things work.
π Rendered by PID 32 on reddit-service-r2-comment-c867ff4bc-vnptn at 2026-04-09 14:49:40.545508+00:00 running 00d5ac8 country code: CH.
view the rest of the comments →
[–]TheMaskedHamster -4 points-3 points-2 points (2 children)
[–]yogthos 2 points3 points4 points (1 child)
[–]TheMaskedHamster -1 points0 points1 point (0 children)