On Jun 25, 3:52 pm, Mike Hinchey <hinche...@gmail.com> wrote:
> Instead of eval in the doseq, you could use a macro with a do block,
> something like:
> user> (defmacro deftags [tags]
> `(do ~@(map (fn [tag]
> `(defn ~(symbol (str tag "-with"))
> [block#] (str ~tag block#)))
> tags)))
> #'user/deftags
>
> user> (deftags ["html"])
> #'user/html-with
>
> user> (html-with [1])
> "html[1]"
>
> -Mike
>
> On Thu, Jun 25, 2009 at 11:51 AM, CuppoJava <patrickli_2...@hotmail.com>wrote:
>
>
>
> > Thanks for the reply.
>
> > I use doseq instead of map because I need it to run immediately, and
> > I'm not interested in the return values of the functions.
>
> > I also would love to be able to simply the (eval ...) part, but I
> > don't know of any other way to dynamically define a function in
> > Clojure. If you know of a way it'd help me out a lot.
> > -Patrick
I am not looking at the code, I hate when people nitpick every snippet
they see. I don't think that gets anyone anywhere.
But does anyone have a problem with Lisp/S-Expressions to HTML/XHtml,
especially for the entire document. What is wrong with using some
form of templating system. I think that is what Lisp has (see Lisp's
Html-template).
I am not talking about this particular application, but just in
general. I love the ability to take sections of HTML or snippets of
HTML and use that as the View and then break that off from the
application code.
But that is just me.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---