I just noticed this unexpected result for Map destructuring with an
<quote>:or</quote> directive:

<pre>
user=> (def guys-name-map {:f-name "Guy" :l-name
"Steele"})
#'user/guys-name-map

user=> (let [{:keys [f-name m-name l-name] :or {:m-name "CL"}} guys-
name-map] (str l-name ", " f-name "+" m-name))
"Steele, Guy+"

user=> (let [{:keys [f-name m-name l-name] :or {m-name "CL"}} guys-
name-map] (str l-name ", " f-name "+" m-name))
"Steele, Guy+CL"
</pre>

Note that the <quote>:or</quote> directive does not seem to respect/
use the preceeding :keys directive and appears to be doing its lookup
using symbols only. Was this the intended behavior?

Wouldn't it be more useful to extend the behavior of <quote>:or</
quote> to use the same lookup method (:keys, :strs, or :syms) as
specified in the (same) preceeding map context?

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

Reply via email to