Clojure有一个等价的Java的import package。*? [英] Does Clojure have an equivalent of Java's import package.*?

查看:137
本文介绍了Clojure有一个等价的Java的import package。*?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

或者我必须具体枚举我导入的每个类吗?

Or do I have to specifically enumerate every class that I import?

我现在正在学习Clojure,在REPL中可以做这样的事情似乎有用:

I'm just learning Clojure now, and it seems useful to be able to do something like this in the REPL:

(import '(java.io *))

不是这是有效的语法,但是有一些相当的东西是很好的。它会节省一些打字,特别是当修补。在实际的生产代码中,我总是枚举每一个我要导入的类,不管语言如何,但是非常方便,不必这样做。

Not that this is valid syntax, but it would be nice to have something that does the equivalent. It would save some typing, especially when tinkering around. In actual production code I always enumerate each class that I'm importing, regardless of the language, but it's pretty convenient not to have to do so.

推荐答案

Rich Hickey 解释了为什么不可能 a>。

Rich Hickey explains why it is not possible.

这篇关于Clojure有一个等价的Java的import package。*?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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