如何在Windows中的测试项目中处理名称冲突/阴影? project.clj 包含以下lib声明:
:dependencies [[org.clojure/clojure "1.5.1"]
[incanter/incanter-core "1.5.4"]
[org.clojure/data.json "0.2.3"]
]
一旦我开始 repl ,我就会添加:
user=> (use 'incanter.core) ;the answer is nil
user=> (use 'clojure.data.json)
WARNING: read already refers to: #'clojure.core/read in namespace: user, being r
eplaced by: #'clojure.data.json/read
IllegalStateException pprint already refers to: #'clojure.pprint/pprint in names
pace: user clojure.lang.Namespace.warnOrFailOnReplace (Namespace.java:88)
提前谢谢你!
答案 0 :(得分:5)
您可以告诉use
重命名或隐藏这些函数,但最好的方法可能是require
命名空间用较短的名称而不是use
,即
(require '[clojure.data.json :as json])
允许您按名称json/read
,json/pprint
使用其功能......