Re: Function of clojure.templates

2009-07-21 Thread Stuart Sierra
Hi Tim, Samppi, clojure.contrib.template (since renamed clojure.template) has gone through a couple of different forms. Basically, do-template does something similar to "map" but at compile time. This was necessary for the "are" macro in clojure.contrib.test- is (since renamed clojure.test). L

Re: Function of clojure.templates

2009-07-21 Thread Tim Snyder
apply-template is used internal to the template namespace by the do- template macro. The do-template macro that allows you to apply some code to groups of arguments. In order to get what I think you're after, use do-template in the following fashion: (do-template (+ _1 _1) 2) --> (+ 2 2) On Jul

Function of clojure.templates

2009-07-20 Thread samppi
I've just discovered the clojure.templates library [1], and I'm wondering what's the difference between its function and that of regular functions: (apply-template '[x] '(+ x x) '[2]) ((fn [x] (+ x x)) 2) [1] http://github.com/stuarthalloway/clojure/blob/6ee62ec1d88383e1caadb8b93a19fd389c001