I actually would really like to be able to use :keys to bind
namespaced keywords to local names. This would be exceedingly handy
for example when working with datomic data.
I would want this:
(let [{:keys [a/x]} {:a/x 5}]
x)
;=> 5
That is, you would fully qualify the symbol name in the :keys vector,
but the local bound to it would remain local and unqualified.
There would of course be the potential for keys that could not be
bound this way, for example if the map was {:a/x 5, :b/x 10}. But we
already have this kind of problem for example when using both :strs
and :keys and a map like {:x 5, "x" 10}. In practice this is rarely an
issue, and when it comes up you simply have to use the more verbose
destructuring.
What do you think?
--Chouser