I’m a clojure beginner. How do I create a map from a lazySeq?
(def fields [:name :age :color])
(def values ["joe" 32 "red"])
(def record (interleave fields values))
(def mymap (into {} record)) ;; ????
;; (get mymap :age)
;; 32
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
To answer your actual question:
But since you actually already have separate keys and values, I would suggest skipping the interleave step and instead writing
Or if you have your heart set on
into, you could