Hi,
Templates return a lazy-seq, so it's the opposite behaviour of being created by bound-fn that you observe.
The most expedient way to solve this problem is to have a middleware which calls doall (or map (bound-fn [x] x) if you want to preserve laziness) on the :body of the response map -- thus the lazy seq evaluation will happen inside the dynamic scope set by upstream middlewares.
Given that per Ring's spec, :body may be lazy seqs, I would tend to say that it's up to the authors of middlewares which introduce dynamic binding to ensure that this case is covered.
I don't want to fix this systematically at the heart of Enlive because bound-fn incurs a overhead.
However in a first time, I'm ok with shipping a body-forcing middleware before finding a better solution. Would it be ok with you?
hth,
Christophe
--
Professional:
http://cgrand.net/ (fr)
On Clojure:
http://clj-me.cgrand.net/ (en)