Clojure Loop and count

460 views Asked by At

I am trying to get a link for each photoset. It should look like this:

[:p (link-to (str "/album?photosetid="photosetid) photoset-name)

In the following code I get a map of all photoset ids and names:

(def ids (map #(str "/album?photosetid=" %1) photoset-id))
(def names (map #(str  %1) photoset-name))

After that i try to create the links:

  (loop [x (count ids)]
    (when (> x 0)
      [:p (link-to (nth ids x "") name) (nth names x "")]
      (recur (- x 1))
      )
    )

The problem is that I don't get any output.

Thanks for any help!

1

There are 1 answers

3
Leon Grapenthin On BEST ANSWER
(map #(vector :p (link-to (str "/album?photosetid=" %1) %2)) ids names)