You could do this without adding anything to hiccup.

If you wrote a function that, say, used walk, you could have it go
through the vectors, and replace the custom tags with what they
represent. Then you could just call that before calling `html'.

(html
  (transform
    [:html
      [:head
        [:title "some page"]]
      [:body
        [:link-to {:url "http://www.google.com/"} "Hi this is Google"]]]))

The benefit to doing it this way over having the macro is that it's
clear where the custom tags come from when looking at the invocation
of `html'.

If you really want `html' to handle it, maybe it could be called with
a map of tranform functions?

(html {:link-to link-to}
 [:html
   [:head
     [:title "some page"]]
  [:body
    [:link-to {:url "http://www.google.com/"} "Hi this is Google"]]])

Either way, I think this ends up being nicer than a macro that changes
the behavior of `html'.


On Sunday, May 13, 2012 12:35:46 AM UTC-4, Murtaza Husain wrote:
>
>
>

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

Reply via email to