Why does clojure give this arity error

Viewed 804

I have the function definition below for map-edit

(def map-edit
  (fn [m lst k f]
    (if (car lst)
      (assoc m
             (car lst)
             (map-edit (get m (car lst) {}) k f))
      (assoc m k (f (get m k))))))

When I try to call this function in my repl

(map-edit {} (list "oeu") "oeuoeu" (fn [q] "oeu"))

I get an error for Arity

ArityException Wrong number of args (3) passed to: core/map-edit  clojure.lang.AFn.throwArity (AFn.java:429)

Why does it think I am only passing 3 arguments?

; CIDER 0.8.2 (Java 1.8.0_121, Clojure 1.8.0, nREPL 0.2.12)
2 Answers
Related