> > > It takes as arguments
> > > * the list of interfaces it implements (currently necessary for
> > >http://www.assembla.com/spaces/clojure/tickets/181)
>
> > ?? You always have to specify the interfaces, no?
>
> What I meant is that if I always implement SignalX$Listener, I could
> even get rid of the interfaces list as argument to the macro as it can
> be derived from the number or arguments that will be passed to
> trigger.
> I could write
> (create-listener [a1 a2 a3] ( do-stuf a b c ) )

Here is the macro I came up with:

(defmacro create-listener [ args & body]
  (let [argsnum# (count args)]
  `(proxy [ ~(symbol (str "Signal" argsnum# "$Listener")) ] []
(trigger ~args ~...@body))))



--~--~---------~--~----~------------~-------~--~----~
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 moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to