I apologize for this question, because I think it has been asked before, 
and yet I can not find the answer. 

In the definition of zipmap, what do these 2 lines do?

ks (seq keys)
vs (seq vals)

In particular, what is (seq) doing? Is this to ensure that ks is false if 
"keys" is empty? And vs is false if "vals" is empty? Because an empty list 
(or vector) is truthy but we want it to be falsey in this situation?  

Is there any other reason to use (seq), other than to set the truthy/falsey 
values of ks and vs? 


(defn zipmap
"Returns a map with the keys mapped to the corresponding vals."
{:added "1.0"
:static true}
[keys vals]
(loop [map {}
ks (seq keys)
vs (seq vals)]
(if (and ks vs)
(recur (assoc map (first ks) (first vs))
(next ks)
(next vs))
map))) 

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to