Hi,

I sometimes find myself wanting to write simple conditional expressions inside 
-> and ->>. For example, it would be nice to create Ring responses like this:
(-> {}
    (status code)
    (content-type "application/json;charset=utf-8")
    (when (= error-type :unauthorized)
      (header "WWW-Authenticate" "Basic realm=\"my-realm\""))
    (when (not= request-method :head)
      (assoc :body (json-str ...))))

The above obviously doesn't work, but is there some other macro somewhere that 
would enable me to do this?

Best regards,
Miikka

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