Re: Stack Overflow Question

2016-12-25 Thread Jiacai Liu
I have left a comment below your answer on StackOverflow, can you explain it a little more. thanks On Saturday, December 24, 2016 at 11:12:03 PM UTC+8, James Reeves wrote: > > On 24 December 2016 at 11:48, Jiacai Liu > > wrote: > >> how to make correct fn args when create fn using macro >> http:

Re: Stack Overflow Question

2016-12-24 Thread James Reeves
On 24 December 2016 at 11:48, Jiacai Liu wrote: > how to make correct fn args when create fn using macro > http://stackoverflow.com/q/41312963/2163429?sem=2 > For reference, I posted an answer on StackOverflow. - James -- You received this message because you are subscribed to the Google Grou

Re: Stack Overflow Question

2016-12-24 Thread Jiacai Liu
your version is obviously wrong, when '~param will try to resolve param, but no luck On Saturday, December 24, 2016 at 10:07:15 PM UTC+8, Jim foo.bar wrote: > > try the following: > > (defmacro defapihandler [handler-name params & body] > `(defn ~handler-name ['~passed-param] > (let [par

Re: Stack Overflow Question

2016-12-24 Thread dimitris
try the following: |(defmacrodefapihandler [handler-name params & body]`(defn~handler-name ['~passed-param](let[param-keys# (vec(map(comp symbol name :key)~params)){:keysparam-keys#}'~passed-param];; some check~@body))) | Sorry for brevity, I'm on my phone... Dimitris On 24/12/16 13:23, Jiac

Re: Stack Overflow Question

2016-12-24 Thread Jiacai Liu
I don’t think your answer is correct. From the expaned macro (defn create-user [passed-param__10243__auto__] (let [param-keys__10244__auto__ (vec (map (comp symbol name :key) [{:key

Re: Stack Overflow Question

2016-12-24 Thread dimitris
you need to use `'~passed-param` in your arg-vector, and the same whenever you use it inside the newly defined fn. HTH, Dimitris On 24/12/16 11:48, Jiacai Liu wrote: how to make correct fn args when create fn using macro http://stackoverflow.com/q/41312963/2163429?sem=2 -- You received this

Stack Overflow Question

2016-12-24 Thread Jiacai Liu
how to make correct fn args when create fn using macro http://stackoverflow.com/q/41312963/2163429?sem=2 -- 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