Hi James,
I really appreciate your code,it really help me much.
just a little modification:
(defn batchly-redis [cmd params]
(doseq [p params]
(apply cmd p)))
doseq requires an even number of args
在 2014年2月25日星期二UTC+8下午6时33分48秒,James Reeves写道:
>
> You could just write it as a function and
You could just write it as a function and leave out wcar*.
(defn batchly-redis [cmd params]
(doseq [params]
(apply cmd params)))
Then to execute:
(wcar* (batchly-redis cat/set parameters))
As far as I can tell, wcar is just a container macro, like with-open, in
that it initiates the conne
hi JW,
First thank you for your reply.
my origin question is somethine about redis.here i refer
https://github.com/ptaoussanis/carmine
I follow this two line
(def server1-conn {:pool {} :spec {}}) ; See `wcar` docstring
for opts
(defmacro wcar* [& body] `(car/wcar server1-conn ~@body))
then I
Well the evil thing is that apply-macro evaluates arguments at compile
time. Example where this won't work follows
(defn foo [numbers]
(apply-macro + numbers))
JW
On Mon, Feb 24, 2014 at 10:27 AM, 刘家财 wrote:
> I have one problem using Clojure
> we all know there is a apply for a fn to prepe
I have one problem using Clojure
we all know there is a apply for a fn to prepend intervening arguments to
args.
such as (apply + [2 3]) will equals to (+ 2 3)
this is really handy,
BUT,this is no apply-macro fn to use,I find a contrib(
https://github.com/clojure/clojure-contrib/blob/73accf597eaf