【发布时间】:2011-12-29 09:37:53
【问题描述】:
user=> (Integer/rotateRight 0 0)
0
user=> (apply Integer/rotateRight [0 0])
CompilerException java.lang.RuntimeException: Unable to find static field:
rotateRight in class java.lang.Integer, compiling:(NO_SOURCE_PATH:172)
有没有办法在 Clojure 中申请 java 函数?如果不是,我怎么能写一个支持这个的宏或函数?
【问题讨论】:
-
有趣:计划将自动方法包装器生成与未来的 Clojure 编译器重写相结合dev.clojure.org/display/design/Better+method+inference