使用Clojure 1.3打破clojure.contrib中的一些代码?

eur*_*eka 4 clojure

由于Clojure 1.3"Earmuffed Vars不再自动被认为是动态的",clojure.contrib中的一些代码依赖于此功能,它们不再起作用.例如,clojure.contrib.sql中的db.

 Warning: *db* not declared dynamic and thus is not dynamically rebindable, but its name suggests otherwise. Please either indicate ^:dynamic *db* or change the name.
 Exception in thread "main" java.lang.RuntimeException: java.lang.ExceptionInInitializerError
Run Code Online (Sandbox Code Playgroud)

contrib库仍在1.2版本中.如何解决这个问题?或者是否有一些alpha或预发行版本的contrib lib可以与Clojure 1.3一起使用?

Pau*_*aul 6

当Clojure转向1.3时,决定放弃整体贡献,即一个带有一系列独立项目的Contrib库.之所以这样做是因为有些图书馆已被遗弃,很难让人们将它们升级为1.3.

此外,一些图书馆也改名了.概述可以在这里找到:http://dev.clojure.org/display/doc/Clojure+Contrib 特别是contrib.sql库已更名为java.jdbc现在住在这里https://github.com/clojure/java .jdbc