How many parameters does my-up-date-in require? How many parameters did the invocation provide? That’s the arity error.
Also, keep in mind an interesting subtlety of the real update-in, which is, that its return value is not the return value of the function that the caller provides!
(defn my-update-in [m ks f ]
(let [up (fn up [m ks f ]
(let [k (first ks)
r (rest ks)]
(if (empty? r)
(assoc m k (f (get m k )))
(assoc m k (up (get m k) r f )))))]
(up m ks f)))
(let [up (fn up [m ks f args]
(let [k (first ks)
r (rest ks)]
(if (empty? r)
(assoc m k (apply f (get m k) args))
(assoc m k (up (get m k) r f args)))))]
(up m ks f args)))
Have you had a look at the varargs section in the link I sent you? update-in should take the map, path to update, a function, and any number of arguments to that function.
What you have there is almost verbatim the clojure.core/update-in body, but missing the varargs part.