How do I import the entire package but exclude som

2019-02-22 00:55发布

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

 (ns com.wekatest
 (:import  (weka.classifiers Classifier Evaluation)
           (weka.classifiers.functions)
           (weka.core Attribute FastVector Instance Instances)))

Edit: (weka.classifiers.functions) doesn't import the entire package. How do I do that?

1条回答
劳资没心,怎么记你
2楼-- · 2019-02-22 01:27

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).

查看更多
登录 后发表回答