Maybe I’m doing something wrong… or maybe what I’m trying to do is maybe just “bad Clojure”
So I often have little “utility” functions. Say for instance I have a code snippet that makes a map out of the CSV vector-of-vectors output by clojure.data.csv/read-csv
.
What I’d like to do is wrap and extend clojure.data.csv
(and maybe rename some of its functions) - but I’m fighting the ns
macro. I can write my own my-csv
library. It can require
or use
the functionality in clojure.data.csv
and write some csvvec-2-map
function. But I don’t know how to forward all the symbols.
especially if I want to rename some function… I’d like to require
one library and not have to require both my-csv
and clojure.data.csv
and then track where is what.
I also have a set of libraries that I use in virtually all my projects. I kinda don’t want to keep copy and paste’ing a bloated ns
declaration across every project and I’d like to consolidate everything into one wrapper ns
that I can then (:require all-my-standard-libs)
But when I try this, I notice the what’s :rename
’ed or :use
’d inside a ns
isn’t forwarded to the library user - nor do I know a mechanism to do it
How are people handling this…? Especially on large projects, I imagine you have huge ns
decls that are all virtually the same across all the project’s ns
’s