let's assume I first define a
user=> (def a [:w :n :e :s])
#'user/a
user=> (partition 2 1 (conj a (first a)))
((:w :n) (:n :e) (:e :s) (:s :w))
gives you the pairs you need.
then you just need to turn it into hash-map
by doing
(map #(apply hash-map %) (partition 2 1 (conj a (first a))))
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clo...@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+u...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
--
Omnem crede diem tibi diluxisse supremum.
I think the docs should be fixed to refer to "logical false" like
other parts of the documentation, instead of "nil".
e.g.:
(find-doc "logical false")
[...]
clojure.core/when-not
([test & body])
Macro
Evaluates test. If logical false, evaluates body in an implicit do.
nil
--
Michael Wood <esio...@gmail.com>