1
(defn make-heavy [f] 
  (fn [& args]
    (Thread/sleep 1000)
    (apply f args)))

(defn doRunThroughSplit [vector NoOfLines]
;the function is too long

(def zzz [34877 30287 18160 22981])

它们是具有行数的 4 个文件

(time (def abc (map (make-heavy doRunThroughSplit [x1 n1 m1 b1] zzz))))

似乎我不断收到这个异常,我不明白为什么

ArityException Wrong number of args (3) passed to: final$make-heavy clojure.lang.AFn.throwArity (AFn.java:437)

make Heavy 函数实际上是从实用的 clojure 中复制而来的。

4

1 回答 1

2

可以想象,这就是你想要的:

(defn make-heavy [f] (fn [& args] (Thread/sleep 1000) (apply f args)))

(defn doRunThroughSplit [NoOfLines] (println "noOfLines=" NoOfLines))

(def zzz [34877 30287 18160 22981])

(time (def abc (map (make-heavy doRunThroughSplit) zzz)))
于 2013-06-30T04:09:47.270 回答