【发布时间】:2012-01-27 18:48:52
【问题描述】:
我可以发誓我以前有 alength 工作,但我不太清楚我现在做错了什么:
user=> (alength '(1 2 3))
IllegalArgumentException No matching method found: alength clojure.lang.Reflector.invokeMatchingMethod (Reflector.java:79)
user=> (alength [1 2 3])
IllegalArgumentException No matching method found: alength clojure.lang.Reflector.invokeMatchingMethod (Reflector.java:79)
user=> (doc alength)
-------------------------
clojure.core/alength
([array])
Returns the length of the Java array. Works on arrays of all
types.
nil
我应该怎么做才能在 Clojure 中获取列表/数组的长度?
【问题讨论】:
标签: clojure functional-programming