<div class="gmail_quote">On Mon, May 3, 2010 at 5:04 AM, Seth Burleigh <span dir="ltr"><<a href="mailto:seth@tewebs.com">seth@tewebs.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

(1) A C/C++ program wants to call a lisp function with its own data<br>
structures:<br></blockquote><div><br></div><div>These are called "callbacks". All foreign function interfaces for Lisp support them, including CFFI and ECL. However ECL currently gives them rather "obscure" names and does not export them.</div>

<div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">(2) Intertwined development/tight integration: if an algorithm needs to<br>
be implemented in c/c++ for efficiency, it is much more convenient to<br>
define it in the lisp code than create another c/c++ file<br></blockquote><div><br></div><div>CLINES allows you to embed arbitrary C/C++ code in the file. The only thing you will not get is that the code is produced in an order which is consistent with the execution of Common Lisp forms. In other words, if you insert a CLINES statement in a function it will be moved out of it to the beginning of the generated C file.</div>

<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Of course, the code would also have to be able to call lisp functions<br>
defined in the current package in order for this to be effective (or to<br>
be able to call lisp functions which have been designated as<br>
'callbackable', like in gambit-c scheme) [...]<br></blockquote><div><br></div><div>Se above.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">


(3) Programs built in c++ already have a class hierarchy. If you want to<br>
create a subclass which the c++ program can use, you need to be able to<br>
directly input toplevel code (i.e. define a class, methods, etc).<br></blockquote><div><br></div><div>CLINES</div><div><a href="http://ecls.sourceforge.net/new-manual/re13.html">http://ecls.sourceforge.net/new-manual/re13.html</a></div>

<div><br></div><div>I insist that this is mostly used for headers, but it need not be.</div><div><br></div><div>Juanjo</div><div><br></div></div>-- <br>Instituto de Física Fundamental, CSIC<br>c/ Serrano, 113b, Madrid 28006 (Spain) <br>

<a href="http://tream.dreamhosters.com">http://tream.dreamhosters.com</a><br>