Re: My first attempt at a macro: "can not recognize symbol"

2013-12-10 Thread Cedric Greevey
On Tue, Dec 10, 2013 at 12:53 PM, James Reeves wrote: > Remember that only the last form will be returned. So: > > (defn foo [] 1 2 3 4) > > `(defn ~start-function-name [] > will always return 4. The same principle applied with your macro. You > define four forms, but only return the last on

Re: My first attempt at a macro: "can not recognize symbol"

2013-12-10 Thread larry google groups
Thanks much. Your approach is much better than mine. I was looking for a good excuse to use a macro, but I suppose I will postpone that for another day. On Tuesday, December 10, 2013 2:03:07 PM UTC-5, James Reeves wrote: > > On 10 December 2013 18:24, larry google groups > > > wrote: > >> >>

Re: My first attempt at a macro: "can not recognize symbol"

2013-12-10 Thread James Reeves
On 10 December 2013 18:24, larry google groups wrote: > > > As an aside, this doesn't look like a good use-case for macros > >. You'd probably be better defining a map with keys for : > > worker, :channel, etc. Either that or a protocol. > > Thank you much for your help. But I thought this is exac

Re: My first attempt at a macro: "can not recognize symbol"

2013-12-10 Thread larry google groups
> As an aside, this doesn't look like a good use-case for macros >. You'd probably be better defining a map with keys for : > worker, :channel, etc. Either that or a protocol. Thank you much for your help. But I thought this is exactly what macros were for? In another language I would end up ju

Re: My first attempt at a macro: "can not recognize symbol"

2013-12-10 Thread James Reeves
Remember that only the last form will be returned. So: (defn foo [] 1 2 3 4) will always return 4. The same principle applied with your macro. You define four forms, but only return the last one. Instead, try wrapping all the forms in a "do" block. As an aside, this doesn't look like a good

My first attempt at a macro: "can not recognize symbol"

2013-12-10 Thread larry google groups
I am working on web software where admins will be using HTML forms to update data in a MongoDb database. I decided to use Lamina to off-load the work to the background. There are several operations that need to happen: updates, deletions, etc, and I thought I'd put each on a different channel.