I want to combine elements from two lists, my program looks like this
(ns datamodel
(:use
[net.cgrand.enlive-html :as en-html ])
(:require
[clojure.zip :as z]
[clojure.data.zip.xml :only (attr text xml->) :as xz]
[clojure.xml :as xml ]
[clojure.data.zip.xml :as zf]
[clojure.java.io :as io]
))
(def data-url "http://api.eventful.com/rest/events/search?app_key=4H4Vff4PdrTGp3vV&keywords=music&location=Belgrade&date=Future")
(defn map-tags-contents [url & tags]
(map #(hash-map % (keyword (last tags)))
(mapcat (comp :content z/node)
(apply xz/xml->
(-> url xml/parse z/xml-zip)
(for [t tags]
(zf/tag= t)
)))))
(def titles (map-tags-contents data-url :events :event :title))
(def descriptions (map-tags-contents data-url :events :event :description))
(defn create-map [](for [el1 titles
el2 descriptions] (into {} (conj el1 el2 ))))
But when I call create-map resulting maps in list are duplicated. I see that I got Cartesian join, because I didn't say the way elements will be combined. And I want first element from first map and first from second map to be combined, second element from first map and second from second map, etc...