Re: Can't eval locals problem

2011-10-19 Thread Razvan Rotaru
Thanks for your suggestion. I finally decided to find a way around the problem. :) This is cutting too deep for me to handle with my current clojure knowledge. I also talked to Constantine Vetoshev (the author of appengine-magic) and he anknowledged it as an issue which could have a solution by

Can't eval locals problem

2011-10-03 Thread Razvan Rotaru
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

Re: Can't eval locals problem

2011-10-03 Thread Joop Kiefte
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

Re: Can't eval locals problem

2011-10-03 Thread Stuart Halloway
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

Re: Can't eval locals problem

2011-10-03 Thread Michał Marczyk
eval does work at macro expansion time, but only where it is actually possible to evaluate the expression its given with only the information available at macro expansion time at hand. One case where there is not enough information -- and a minimal Can't eval locals example -- is the following:

Re: Can't eval locals problem

2011-10-03 Thread Michał Marczyk
Ok, so I mailed off the above discussion without including any suggestions for alternative approaches... *fail* Anyway, I think Joop's answer (especially the first code snippet) is *very* likely to be the best. As far as I can tell from reading the source, appengine-magic's query macro includes