Re: Pros and cons of macro versus functions

2010-10-18 Thread Mike Meyer
On Mon, 18 Oct 2010 08:58:48 -0400 (EDT) lprefonta...@softaddicts.ca wrote: > Choose functions over macros when you can write an equivalent function. >From the LISP community, I'd put it slightly stronger: Only use macros when you have to. But you get the same set of reasons (with explanations).

Re: Pros and cons of macro versus functions

2010-10-18 Thread lprefontaine
Choose functions over macros when you can write an equivalent function. I use macros when: a) I have a repetitive pattern in the code that cannot be easily turned into a function (too much context to pass as args to a function). You can then hide a binding form in the macro to refer to the

Pros and cons of macro versus functions

2010-10-18 Thread jbk
I'm new to Clojure and just getting my head around macros. As an exercise I was trying different ways to wrap making a proxy for java.util.Comparator and came up with two alternatives. I'm really not sure how to judge what would favour one solution over the other, and I'm curious if one style is pr