Could someone explain why the first doesn't work and the 2nd does?

(let [{:keys [opt1]}  [:opt1 true]] [opt1]) ==> [nil]

(let [{:keys [opt1]} '(:opt1 true)] [opt1]) ==> [true]

According to http://clojure.org/guides/destructuring

"Associative destructuring also works with lists of key-value pairs for 
keyword-arg parsing."

If I read the definition literally, I see, it says "lists" and not 
"sequences", so the behaviour is correct, so maybe a better question is why 
the definitions isn't

"Associative destructuring also works with sequences of key-value pairs for 
keyword-arg parsing."

It this specific case, when you destructor the args, it looks like a 
vector, but internally it is a list, so it works. 

Happy New Year!

-- 
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