As Benjamin said, proxy does not support variable arg list with &, multiple
arity is
used in the following way:
(method-name
([arg0] ...)
([arg0 arg1] ...))
Jonathan
On Sun, Jun 19, 2011 at 10:58 AM, Benjamin Teuber
wrote:
> Some remarks:
>
> > (defmacro make-msg-ewrapper [method-names]
> m
Some remarks:
> (defmacro make-msg-ewrapper [method-names]
maybe use [& method-names] so people can write (make-msg-wrapper a-
method-name another-method-name)
> `(proxy [EWrapper] []
> ~@(map
> (fn [method-name]
> (let [args (gensym "args")]
this line seems completely us
So I realized that the method wasn't being found because args# is a
single argument, and I actually need it spliced in.
At this point I'm rather stuck. For example:
(defmacro make-msg-ewrapper [method-names]
`(proxy [EWrapper] []
~@(map
(fn [method-name]
(let [args (gensy
Hi David,
Yes, the expansion I essentially want, and which runs properly without
the macro:
(proxy [EWrapper] []
(tickPrice [& args] (println "tickPrice" (. EWrapperMsgGenerator
tickPrice args)))
(tickSize [& args] (println "tickSize" (. EWrapperMsgGenerator
tickSize args)))
... other metho
On Fri, Jun 17, 2011 at 11:51 PM, Jian Liu wrote:
> Hi Clojure Gurus :)
>
> I've a somewhat contrived use-case for macros that I've been
> struggling with.
>
> Let's say there's an interface called EWrapper that I'm trying to
> implement with methods "tickPrice" and "tickSize", a concrete class
>