[cffi-devel] Converting foreign structures with CFFI generic functions
Liam Healy
lnp at healy.washington.dc.us
Fri Sep 9 14:30:28 UTC 2011
On Thu, Sep 8, 2011 at 6:20 AM, Luís Oliveira <luismbo at gmail.com> wrote:
> 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'm having trouble with this. If I simply make it a superclass, I get
an error: Must specify an ACTUAL-TYPE. If I fill the slot when I try
to define the class, I get an error that complex is not a CFFI type.
I'm not knowledgeable about the various classes and what an alias type
means, etc. Can you fill me in on exactly how the new type class
should be made when it is a subclass of both foreign-struct-type and
enhanced-foreign-type?
Liam
More information about the cffi-devel
mailing list