2

Hello fellow Clojurians,

I would like to make my Clojure project extensible by auto-loading its plugin namespaces from the classpath. I would like to solve it by require-ing every namespace that has a given prefix.

(require-all-ns 'module.custom)
;; this should require module.custom.video, module.custom.audio, module.custom.xxx, ...
  1. Obviously all-ns does not work here as it only lists already loaded namespaces.
  2. I can easily find all namespaces by walking the file system. But I want it to work when additional namespaces are inside a jar file on in an other directory on the classpath. I also need it to work when my program is packaged.

My question is: how to require every namespaces from the file system?

Thank you

erdos
  • 3,135
  • 2
  • 16
  • 27

0 Answers0