Clojure: Implementing the assoc-in function
<p><a href="http://www.braveclojure.com/functional-programming/#Exercises" rel="nofollow noreferrer">Chapter 5, Exercise 3</a> in Clojure for the Brave and True requires:</p>

<blockquote>
  <p>Implement the assoc-in function. Hint: use the <code>assoc</code> function and define its parameters as <code>[m [k &amp; ks] v]</code>.</p>
</blockquote>

<p>Although I have found this <a href="https://github.com/dancrumb/clojure-brave-and-true/blob/master/src/clojure_brave_and_true/chapter5.clj" rel="nofollow noreferrer">solution</a> (see lines 39-54), I wondered if there was a different way of doing it. When working on the previous exercise, I found this very clear answer by jbm on <a href="https://stackoverflow.com/a/21393898/1365720">implementing the comp function</a> to be very helpful.</p>

<p>I've been trying to reduce a partial assoc over a conjoined list of keys and apply the returned function to the final value:</p>

<pre><code>(defn my-part-assoc [m k]
  (partial assoc m k))

((reduce my-part-assoc {} [:one :two :three]) "val")
</code></pre>

<p>Needless to say, this doesn't work. I am new to Clojure and functional programming and fear my very basic understanding of reduce is leading me down the wrong path. Please can someone provide a more concise answer?</p>