Luke Crook <[EMAIL PROTECTED]> writes:
> Peter Seibel <[EMAIL PROTECTED]> writes:
>
>> Is there any chance of hacking Swig to
>> generate proper Lispy names?
>
> It goes half way, generating lispy versions of function names, see http://
> www.swig.org/Doc1.3/Lisp.html
It does so. Why half way? What's missing?
>
> But I don't think SWIG generates the lispy equivalents for enums or struct
> members. One of the SWIG CFFI hackers is on this list. Perhaps he can chime
> in
> on this.
>
It does that too, and also gives lot of flexibility.
The doc are bit poorly written (better tutorials are welcome and will be made
part of the official documentation, if submitted as a patch [1]), but if you
analyze the generated code carefully, the function (cl:defun swig-lispify ...)
is the one which does the lispification.
You can also use your own function to do the lispification
by using
%feature("intern_function", "my-lispify") lispsort_double;
for one particular function lispsort_double or,
%feature("intern_function", "my-lispify");
for all the code which is included below this line.
Please look at the generated code in the doc:
(cffi:defcenum #.(swig-lispify "color" 'enumname)
#.(swig-lispify "RED" 'enumvalue :keyword)
#.(swig-lispify "BLUE" 'enumvalue :keyword)
#.(swig-lispify "GREEN" 'enumvalue :keyword))
(cffi:defcstruct #.(swig-lispify "foo" 'classname)
(#.(swig-lispify "a" 'slotname) :int)
(#.(swig-lispify "b" 'slotname) :pointer))
Cheers,
[1]
http://swig.svn.sourceforge.net/viewvc/swig/trunk/Doc/Manual/Lisp.html?view=log
--
Surendra Singhi
http://ssinghi.kreeti.com, http://www.kreeti.com
_______________________________________________
application-builder mailing list
[email protected]
http://www.lispniks.com/mailman/listinfo/application-builder