Re: question regarding macro (ab)usage

2010-09-28 Thread gaz jones
thanks for the reply, you are right! and in fact my real implementation is more like this, i thought that by showing them both as macros in the post it would be easier for people to just skim read the post and compare them side by side. probably just confused the issue, sorry. the thing im really

Re: question regarding macro (ab)usage

2010-09-28 Thread gaz jones
thanks for the lengthy reply! i will play around with these suggestions. like the fact there are less parameters to pass around. On Tue, Sep 28, 2010 at 1:10 AM, Meikel Brandmeyer wrote: > Hi, > > I'm not sure my solution is 100% idiomatic, but has some advantages. > General strategy: minimise ma

Re: question regarding macro (ab)usage

2010-09-28 Thread Nicolas Oury
I hadn't time to read the whole post, but, I I understand it well, this snipset (defmacro with-context [options & body] `(let [context# (create-context options) thread# (create-thread context) sources# (atom {}) receivers# (atom {})] (binding [init-receiver (partial in

Re: question regarding macro (ab)usage

2010-09-27 Thread Meikel Brandmeyer
Hi, I'm not sure my solution is 100% idiomatic, but has some advantages. General strategy: minimise macro usage. Macros are cool, but overrated. Put as much as possible into functions. This has several advantages like easier testing, less macro trap doors, better readability (no # all over the pla