[cffi-devel] Converting foreign structures with CFFI generic functions

Frank Goenninger frgo at me.com
Thu Sep 8 11:06:14 UTC 2011


Am 08.09.2011 um 12:20 schrieb Luís Oliveira:

> On Thu, Sep 8, 2011 at 5:23 AM, Liam Healy <lnp at healy.washington.dc.us> wrote:
>> 6. Finding that (parse-type 'complex) is an instance of neither
>> ENHANCED-TYPEDEF nor ENHANCED-FOREIGN-TYPE, the expand-from-foreignT T
>> method is called, which just returns value (first arg).
>> 
>> So there's a gap here, and I'm not sure how to plug it.  Should I be
>> making complex-type a subclass of enhanced-foreign-type so that the
>> compiler macro picks up the conversion to lisp?
> 
> Oh. That's right, unless it's an enhanced-foreign-type it won't go
> through the translation mechanism. Adding that as superclass should
> work.
> 
> I think we need a new DEFCSTRUCT-like macro, let's call it DEFCSTRUCT*
> for now. *sigh*

May I vote for DEFCSTRUCT-BY-VALUE as its name?

> With a different macro we can (a) implement call-by-value semantics by
> default, (2) add the enhanced-foreign-type superclass by default, and
> probably (3) have a sane value for :CLASS, not sure.
> 
> Does that makes sense?

Yes! 

Go, go, go ! ;-)

Cheers
 Frank



More information about the cffi-devel mailing list