【发布时间】:2013-01-14 16:48:39
【问题描述】:
以下调用:
(String/format "%s" "a")
...在 Clojure 中引发“ClassCastException java.lang.String 无法转换为 [Ljava.lang.Object”异常。
(String/format "%s" (cast Object "a"))
....产生同样的异常。
【问题讨论】:
-
您有什么理由需要使用
String.format而不是Clojure.core/format - 它为您包装了to-array?(format "%s" "a") -
没有理由特别使用 String.format,只是好奇......
标签: clojure