A try:
(let [raw (list :a 1 :b 2 :c 3)]
(->> raw
(partition 2)
(filter #(even? (second %)))
(map vec)
(into {})
(merge {:raw raw})))
=> {:b 2, :raw (:a 1 :b 2 :c 3)}
2016-05-12 15:46 GMT+08:00 hiskennyness <[email protected]>:
> This does what I want but feels nooby-ish, as in "in a month I will do
> this without APPLY":
>
> (let [raw (list :a 1 :b 2 :c 3)]
>> (apply assoc {}
>> :raw raw
>> (apply concat
>> (filter #(even? (second %))
>> (apply hash-map raw)))))
>> ;; => {:raw (:a 1 :b 2 :c 3), :b 2}
>
>
> Am I being too hard on myself?
>
> Meta question: is there a better place to ask such questions?
>
> -kt
>
> --
> 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/d/optout.
>
--
庄晓丹
Email: [email protected] [email protected]
Site: http://fnil.net
Twitter: @killme2008
--
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/d/optout.