Try (defmacro order-query [params] `(ds/query :kind Order :filter (map #(list (key %) (val %)) ~params))) or (defmacro order-query [params] `(ds/query :kind Order :filter (map #(list (key %) (val %)) (eval ~params)))) depending on the necessity of the eval (I suppose you don't really need the eval... the problem was using the eval in the evaluation of a macro I guess... ;)).
2011/10/3 Razvan Rotaru <razvan.rot...@gmail.com> > Ok, so I'm stuck. If any of you more seasoned clojurians have a hint > that could get me out, I will be forever gratefull to him/her: > > I'm trying execute a query against google app engine datastore, using > appengine-magic, with the filter dynamically generated from a map. > Here's the closest code I have been able to come up with: > > (defmacro order-query [params] > `(ds/query :kind Order :filter ~(map #(list (key %) (val %)) (eval > params)))) > > This macro fails with a "Can't eval locals" error. I recognize that > the main issue here is that i'm forcing evaluation of something at > macro expansion time. Apparently clojure does not (fully) support > this, so I'm looking then for alternatives. > > Cheers, > Razvan > > -- > 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 -- 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