Hi,
If you're interested in refactoring out instances of (zipmap (keys m) (vals
m)),
then dynalint 0.1.2 may help.
[com.ambrosebs/dynalint "0.1.2"]
I've added a simplistic case that warns if a
clojure.lang.APersistentMap$KeysSeq or ValsSeq is passed to zipmap.
user=> (require '[dynalint.lint :as dyn])
nil
user=> (dyn/lint)
:ok
user=> (let [m {1 2 3 4}
#_=> ks (keys m)
#_=> vs (vals m)]
#_=> (zipmap ks vs))
WARNING (Dynalint id 1): Should not pass result of clojure.core/keys to
zipmap
WARNING (Dynalint id 2): Should not pass result of clojure.core/vals to
zipmap
{3 4, 1 2}
user=>
Note: dynalint only supports Clojure 1.5.1.
dynalint README <https://github.com/frenchy64/dynalint>
dynalint CHANGELOG <https://github.com/frenchy64/lein-dynalint>
lein-dynalint README <https://github.com/frenchy64/lein-dynalint>
Thanks,
Ambrose
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.