<br>Has anyone of you given a look at what Franz did on this very subject for their Allegro 8.2<br>(<a href="http://www.franz.com/support/documentation/8.2/doc/contents.htm#foreign-functions">http://www.franz.com/support/documentation/8.2/doc/contents.htm#foreign-functions</a>)<br>
(<a href="http://www.franz.com/support/documentation/8.2/doc/foreign-functions.htm#structs-by-value-1">http://www.franz.com/support/documentation/8.2/doc/foreign-functions.htm#structs-by-value-1</a>)<br>They added a keyword argument to their def-foreign-call form and also added<br>
a global variable ff:*pass-structs-by-value* that controls the default value of the keyword arg.<br><br>What do you think of that?<br><br>Cheers,<br><br>Jean-Claude Beaudoin<br><br><div class="gmail_quote">On Thu, Sep 8, 2011 at 1:05 PM, Luís Oliveira <span dir="ltr"><<a href="mailto:luismbo@gmail.com">luismbo@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div class="im">On Thu, Sep 8, 2011 at 5:56 PM, Liam Healy <<a href="mailto:lnp@healy.washington.dc.us">lnp@healy.washington.dc.us</a>> wrote:<br>

> I see this is a simple change to the function call interface: naming<br>
> the struct means call by value; if you want to call by reference, use<br>
> :pointer.<br>
<br>
</div>That's Attila's suggestion. Break it and move on.<br>
<div class="im"><br>
<br>
> We can even make a warning if you call by reference with<br>
> the struct name and don't have FSBV loaded (remember we are going to<br>
> keep this a separate system so that users don't have to load libffi if<br>
> they don't need call by value).<br>
<br>
</div>That's nicer, but fsbv might be loaded for some other reason and thus<br>
silently break existing code.<br>
<div class="im"><br>
<br>
> So this is an incompatible change to<br>
> the call interface, essentially revoking CFFI's prior generosity in<br>
> allowing structure name instead of :pointer.  I definitely don't like<br>
> the idea of making different defcstructs, that will be too confusing<br>
> and a kludge.<br>
<br>
</div>Just to be clear, the older defcstruct would become deprecated,<br>
removed from the user manual, etc.<br>
<div class="im"><br>
--<br>
Luís Oliveira<br>
<a href="http://r42.eu/%7Eluis/" target="_blank">http://r42.eu/~luis/</a><br>
<br>
_______________________________________________<br>
</div><div><div></div><div class="h5">cffi-devel mailing list<br>
<a href="mailto:cffi-devel@common-lisp.net">cffi-devel@common-lisp.net</a><br>
<a href="http://lists.common-lisp.net/cgi-bin/mailman/listinfo/cffi-devel" target="_blank">http://lists.common-lisp.net/cgi-bin/mailman/listinfo/cffi-devel</a><br>
</div></div></blockquote></div><br>