I just wanted a bit of a sanity check… b/c I’ve managed to confuse myself a bit
Do libraries have any significance at the code level?
When I say libraries, I mean the stuff you put into the deps.edn
file… Is it safe to treat a library as effectively a bundle of namespaces? As far as I can see, post jack-in
(or launch process) this becomes opaque from the code perspective.
Furthermore it seems in-code the library’s name is irrelevant - and there isn’t really anything forcing you to use the same name between library and its namespaces
Lately I’ve been really trying to modularize and reuse my code more - so I’ve made about a dozen one-namespace libraries and I’ve been placing them in flat folders with just…
myLibA/deps.edn
mylibA/mylibA.clj
{:deps
{caninputanythinghere {:local/root
pathToLib}
cooldude/fancyLib {:mvn/version
"1.1.1"}
:paths
["."]
}
(ns mylibA) ;; no period separated stuff..
;; my code
The weird part is that for a local library the library name is a meaningless value. (never declared or used anywhere subsequently) …
The whole setup seems to work very well so far. It has helped me modularize my codebase and dependency graph a ton. I reuse the pieces in different scripts and applications. However I don’t see anyone else doing this… so I feel I must be missing something. How will this come back to haunt me?