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:
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
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
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
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
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
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