Hey, This may be not be the answer you are expecting but here it goes anyways..
(defmacro fnd [& rest] `(with-meta (fn ~@rest) {:source '~&form})) would associate the source of the function with the function as its meta data you are defining and you can extract any subset of it for whatever your needs are. Sunil. On Tue, Aug 9, 2011 at 3:30 PM, Michael Jaaka <michael.ja...@googlemail.com>wrote: > Hello, > > Is there any chance to get a list of args like it is for functions > defined by defn ? > I would like to use (count (first (:argslist (meta (fn[ a ] (println > a)))))) for my function which would return wrapper which can accept > optional arguments. Optional args would be decelerated not by caller > but by listener. > > For example: > > (defn button[ message action ] > (let [btn (JButton. message) afn (fnalign action) ] > (println "got" (meta action) ) > (doto btn > (.addActionListener (proxy[ActionListener][] > (actionPerformed[ a ] (afn btn))))))) > > and later both usage would work: > > (button "Show" (fn[ bt ] (alert (.getText bt)) )) > > (button "Show" (fn[ ] (alert "woow") )) > > thanks to magic fnalign function which returns wrapper accepting vary > number of args. > > Thanks in advance! > > -- > 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 -- 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