Hi,
I sometimes (in fact quite often) want to use the -> macro like this:
(-> {}
(assoc :a "a")
(assoc :b (some-fn CTX)))
where CTX should be the current value of the threaded element. Currently,
I'm forced to write a helper function
(defn add-some-fn [ctx]
(assoc ctx :b (some-fn ctx)))
and rewrite my usage of -> to
(-> {}
(assoc :a "a")
(add-some-fn))
This works, of course, but somehow feels awkward (it destroys the
uniformity of my assoc chaining). Is there a more idiomatic way to do this?
--
--
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.