And he does have some eval's in there:

http://github.com/brool/gulliver/blob/master/template-servlet.clj

But my Clojure knowledge isn't yet good enough to tell me whether he's using eval only once or on every render?

It uses eval at runtime, but only once: that code slurps a template, turns it into s-expressions, then uses eval to define a function named `render` in the appropriate namespace. Pretty nice.

That function is just like one defined in Clojure source: it'll get JITed, for example.

One might avoid the (minor) runtime work by "precompiling" templates: translating them into the equivalent Clojure source on disk, which can then be treated like ordinary source files. That's what Cheetah does for Python.

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