On May 28, 9:23 pm, CuppoJava <patrickli_2...@hotmail.com> wrote:
> (defblockfn with_surrounding_text [text func]
>   (println text)
>   (func)
>   (println text))

Okay, but it doesn't seem that much neater than just writing the macro
manually:

(defmacro with-surrounding-text [text & body]
  `(do (println ~text)
       ~...@body
       (println ~text)))

It also adds a layer of indirection. If someone familiar with Clojure
saw the macro, they'd understand what it does. If they saw defblockfn,
they'd have to spend longer working out what the defblockfn macro
does.

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