문제

I have an argument that keeps taking my vector argument and destructuring it, even as I try to avoid it several ways.

Error:

clojure.lang.ArityException: Wrong number of args (5) passed to: core$build-par-sel$fn

Attempt 1:

(defn build-par-sel
  [& {:keys [^clojure.lang.PersistentVector par-vals best-val]}]
  ; Do stuff...
)
(let [best 100.0
          pars [1.0 2.0 3.0 4.0]]
      (let [par-sel (build-par-sel 
                           :par-vals pars
                           :best-val best)]))))

Attempt 2:

(defn build-par-sel
  [& {:keys [par-vals best-val]}]
  ; Do stuff...
)
(let [best 100.0
          pars [1.0 2.0 3.0 4.0]]
      (let [par-sel (build-par-sel 
                           :par-vals pars
                           :best-val best)]))))

Attempt 3:

(defn build-par-sel
  [par-vals best-val]
  ; Do stuff...
)
(let [best 100.0
          pars [1.0 2.0 3.0 4.0]]
      (let [par-sel (build-par-sel pars best)]))))
도움이 되었습니까?

해결책

The exception you paste is reported to happen inside the definition of build-par-sel, in some anonymous function that build-par-sel creates. We can't do more to solve this problem without seeing the body of that function.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top