Thanks guys, that makes perfect sense to me. I have another Enlive question:
I need the _exact_ functionality of the "sniptest" function (which appears to have been removed) in production code. I am trying to create a decorator in compojure that will accept a response body and modify the styling in various ways. I can just use the old sniptest definition: (apply str (emit* ((transformation [:h1] (content "hey")) (html-src (:body response))))) but is there a better way? I'm also not sure what emit* does exactly. Is it breaking :content values out of lists so they stand alone as strings? BTW, I want to thank you Christophe for making this library. It's everything xslt-driven views were supposed to be, but elegant instead of evil. It's also going to be much nicer for the designers than all the custom tags/embedded code frameworks I've used in the past. Rob On Mon, Jul 13, 2009 at 12:37 AM, Christophe Grand<christo...@cgrand.net> wrote: > Hi ! > > On Sat, Jul 11, 2009 at 7:31 PM, Jarkko Oranen <chous...@gmail.com> wrote: >> >> On Jul 11, 6:01 pm, Robert Campbell <rrc...@gmail.com> wrote: >> > Hey guys, >> > >> > I'm just curious why Christophe chose to return seq instead of a str >> > for Enlive for his template functions. >> >> Most likely Enlive generates each of those fragments separately; >> Forcing them into a single string at the end would wasteful in case >> the user intends to write the output into a stream (which can be done >> a fragment at a time.) Thus, leaving the choice to the user seems like >> a good decision. > > Yes you are spot on: most of the time the resulting html is wrote into a > stream (disk/network/pipe). > This is also why I modified Ring to accept a seq of string as the body of a > http response. > > Christophe > > > -- > Professional: http://cgrand.net/ (fr) > On Clojure: http://clj-me.blogspot.com/ (en) > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---