On Sep 12, 10:44 pm, Meikel Brandmeyer <m...@kotka.de> wrote:
> Hi,
>
> On 13 Sep., 04:30, Robert McIntyre <r...@mit.edu> wrote:
>
> > Unless there's a good reason for :or to work the way it does I think
> > that would be a good idea, since then you can define "default" maps
> > somewhere else and use those both with the :or keyword or when
> > calling the function itself.
>
> The default map specifies the default for the symbols which are bound,
> not the source of the values.
>
> (let [{foo :some-key bar "some-other-key" :or {foo 1}} ....] ...)

Sorry Meikel, I don't understand your answer. My question was why does
the
default map not lookup the values using the same lookup method as the
original map (:keys, :strs, or :syms)? Why does it always assume
symbols for keys?


> If you want to provide defaults from outside the function use merge.
>
> (fn-which-does-destructuring (merge defaults-map payload-map))

This sounds like it could be a partial answer but also sounds like it
could be very inefficient
in the case where you have a very large default map. I don't want to
create a new map
which merges my data map and my huge default map; I just want to
lookup things in the default
map in the same way I lookup things in my data 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

Reply via email to