【发布时间】:2012-10-28 15:05:07
【问题描述】:
将 lein repl 与 Clojure 1.4.0 一起使用,我可以定义 Java 字节数组的 ^:const,但我不能用它做任何事情:
user=> (def x (byte-array (map byte [0 1 2 3])))
#'user/x
user=> (alength x)
4
user=> (type x)
[B
user=> (def ^:const cx (byte-array (map byte [0 1 2 3])))
#'user/cx
user=> (alength cx)
CompilerException java.lang.RuntimeException: Can't embed object in code, maybe print-dup not defined: [B@10e6cbd, compiling:(NO_SOURCE_PATH:1)
user=> (type cx)
CompilerException java.lang.RuntimeException: Can't embed object in code, maybe print-dup not defined: [B@10e6cbd, compiling:(NO_SOURCE_PATH:1)
我已经确认这也发生在我的应用中,所以这不仅仅是一个 REPL 问题。
我错过了什么?
【问题讨论】:
标签: clojure