I'm writing a simple photo library app in Clojure. I have a library
map that has the :photos
key which is a vector of photo maps. Then, I have a function that adds a photo to a library---it takes the library object and the photo to be added as arguments.
(defn add-to-library [library photo]
...
)
It returns a library
map with the photo
added.
Now, I want to "map" this function over a list of photos. I need to be able to pass the library
object through from one iteration to the next.
What is the idiomatic way of doing this in Clojure?