On Sep 17, 12:50 pm, Philipp Meier <phme...@gmail.com> wrote:
> Which way would you prefer? What are to advantaces and drawbacks of
> each? The method-map approach seams more fp to me, but, I think that's
> like how multimethods are impemented, aren't they?

I've actually been considering factoring out Compojure's output
generator into middleware, to make RESTful web services easier to
build. For instance, you could use a specialized JSON outputter:

(defroutes web-service
  (GET "/users"
    ["fred" "joe" "bill"]))

(decorate web-service
  json-output)

(web-service {:request-method :get, :uri "/users"})
=> {:status 200
    :headers {"Content-Type" "application/json"}
    :body "[\"fred\" \"joe\" \"bill\"]"}

- James
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to