【发布时间】:2016-03-31 01:02:21
【问题描述】:
我想检查给定列表的编号是否为 0,但我的代码返回 EmptyList cannot be cast to clojure.lang.IFn.
(defn fun [ls]
(println ls)
(println "hello")
(println (count ls))
(if (<= 0 (count (ls))) true
(println "testing")))
#'user/fun
user=> (fun '())
()
hello
0
ClassCastException clojure.lang.PersistentList$EmptyList cannot be cast to clojure.lang.IFn user/fun (form-init4069658807942123979.clj:5)
有没有人可以帮帮我?非常感谢!
【问题讨论】:
标签: clojure