<div> </div>
<div>Hi!</div>
<div> </div>
<div>Recently i've made a project to use graphviz from lisp code through cffi (cl-graphviz at <a href="http://common-lisp.net">http://common-lisp.net</a>). In the process i used the cffi generator of SWIG. It was not perfect so i've taken a look at the source which is in c++. Then i gave up early... :)
</div>
<div> </div>
<div>And the idea: the CFFI/SWIG integration could be done in a different philosophy, where SWIG were used only as a c++ parser and the CFFI generator would be lisp code walking the C side parsed representation (using CFFI).
</div>
<div> </div>
<div>The idea is trollish, because i did not invest enough time to see the big picture, but the generated file had serious trouble with statements like #define FOO (1<<2)|(1<<3). The generator (written in C++) was trying to interpret it with not so much luck. It would be simpler in lisp, and then you could also generate the project specific lisp-side API right on.
</div>
<div> </div>
<div>The problem in general is not simple, because the value in a #define is a plain string, and it's sci-fi to start a C++ parser on that sniplet and walk the AST. In normal circumstances (c++ compiler) that define would go away in the preprocessor stage, but in an FFI you want to use the named values from lisp.
</div>
<div><br clear="all">Enough trolling for now, and thanks for all the work on CFFI, it's great!</div>
<div> </div>
<div>- attila<br><br>(alias 101 on irc &no 'its not lisp code :)</div>
<div> </div>