I have been working with Clojure for a few months now. I am now more
familiar with it then I was even 3 months ago. I am now going back
through some of the early code I wrote, and I see a lot of redundancy
and mistakes. In particular, I notice this function that I wrote to
handle the request map (in a web app that is using Ring and
Compojure):

  (defn process-event [request]
    (let [request1 (process-pre-event-hooks request)
          request2 (process-page-specific-pre-page-hooks request1)
          request3 (process-mid-event-hooks request2)
          request4 (process-page-specific-post-page-hooks request3)
          request5 (process-post-event-hooks request4)]
      request5))

I could probably re-write all of this as Ring middleware, yes?
Functions that take the request map, do something with it, and then
return the new, modified request map -- that is what middleware is,
yes? Or does middleware return a function that is then called on the
request map?

-- 
-- 
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
--- 
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 clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to