macro for export-xml-rpc-method

jcb <[email protected]> Wed, 29 Jul 2009 09:28:35 +0000 (UTC)
Newsgroups gmane.lisp.allegro
Message-ID <[email protected]>
Okay this is driving me nuts. 

The signature of export-xml-rpc-method is:

(export-xml-rpc-method server '("method1" method1) :int :int :int)

Where  ":int :int :int" can be a variable number of arguments. 

Instead of coding 90 gazillion calls to export-xml-rpc-method, I would like to 
have one call that is fed by a list of exported methods and their return 
types and argument types:

(defparameter *my-methods* 
    '((("wg-base.foo" foo) :struct :string :int :string :string)
      (("wg-base.bar" bar) :int :struct)
      (("wg-base.barf" barf) :array)))

I have fiddled unsuccessfully with the following:

(defmacro call-export (server method-spec types-list)
   `(export-xml-rpc-method ,server ',method-spec ,@types-list))

(defun export-my-methods (server)
  (mapcar #'lambda (exported-method)
                                      (destructuring-bind (method &rest types) exported-method
                                         (call-export server method types))) *my-methods*))

...which does not compile. 

Is there a way to do this or am I completely crazy for even trying...???  

LOL my posting keyword is "decimates". You got that right brother.
-JCB