On 10/25/12 6:24 PM, Jason Bennett wrote:
Let's say I have a set of thread-first calls:
(-> url
a
b
c
d
e)
And let's say that I need to process and save the result of function b
as a second parameter to function e (function b returns a file, and
function e needs the extention of that file). How would I drop a let
into the middle of the thread calls without making a large mess? The
only suggestion I've gotten so far is to move calls A and B into a let
before the thread-first so I can process their return values.
jason
Pallet's thread-exp library has a let-> macro that would do the trick:
https://github.com/pallet/thread-expr/blob/develop/src/pallet/thread_expr.clj#L100-106
I love the thread-expr library but when I spoke with Hugo Duncan at
Clojure West he said that pallet's use of it was largely being replaced
by monads.
-Ben
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en