On Mon, Mar 19, 2012 at 2:40 PM, Bojan wrote:
> Hi!
>
> I'm a beginner at clojure and enjoying the learning process. While writing
> my first nontrivial program, I noticed that I'm transforming only first
> elements in the list, so I factored this transformation out by writing next
> function:
>
>
On Mon, Mar 19, 2012 at 9:40 AM, Bojan wrote:
> Hi!
>
> I'm a beginner at clojure and enjoying the learning process. While writing
> my first nontrivial program, I noticed that I'm transforming only first
> elements in the list, so I factored this transformation out by writing next
> function:
>
>
Hi!
I'm a beginner at clojure and enjoying the learning process. While writing
my first nontrivial program, I noticed that I'm transforming only first
elements in the list, so I factored this transformation out by writing next
function:
(defn map-first [f coll]
(map #(cons (f (first %)) (res