如何导入整个包,但排除Clojure中的一些? [英] How do I import the entire package but exclude some in Clojure?

查看:112
本文介绍了如何导入整个包,但排除Clojure中的一些?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要导入整个weka.classifiers.functions包,但不想导入RBFNetwork类。

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

编辑:(weka.classifiers.functions)不导入整个包。

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

推荐答案

Clojure不提供一种方法来导入Java包中的每个类, 。请参阅Rich Hickey对基本上相同问题的回复: http:// groups。 google.com/group/clojure/browse_thread/thread/fa00a0ff4c264f9a

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

这并不排除您编写添加此功能的代码,但Rich也提及为什么这可能很困难(Java包不可枚举,所以你必须走的类路径知道每个包内的类)。

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

这篇关于如何导入整个包,但排除Clojure中的一些?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆