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).  Look at clojure.test/are for an
example of its use.

-SS



On Jul 21, 8:33 am, Tim Snyder <tsnyder...@gmail.com> wrote:
> 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 21, 1:13 am, samppi <rbysam...@gmail.com> wrote:
>
> > 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/6ee62ec1d88383e1caadb8b...
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to