How do I import the entire package but exclude some in Clojure?

后端 未结 1 801
北恋
北恋 2021-01-18 03:26

I want to import the entire weka.classifiers.functions package but dont want to import RBFNetwork class.

 (ns com.wekatest
 (:import  (weka.classifiers Class         


        
相关标签:
1条回答
  • 2021-01-18 04:03

    Clojure does not provide a way to import every class in a Java package without specifying each class explicitly. See here for Rich Hickey's response to essentially the same question: http://groups.google.com/group/clojure/browse_thread/thread/fa00a0ff4c264f9a

    This does not preclude you from writing code that would add this functionality, but Rich also mentions why this could be difficult (Java packages are not enumerable, so you would have to walk the classpath to know what classes are inside each package).

    0 讨论(0)
提交回复
热议问题