Problems with nested structs and the newer cffi

Willem Rein Oudshoorn woudshoo at xs4all.nl
Thu Apr 25 06:51:43 UTC 2013


Liam Healy <lnp at healy.washington.dc.us> writes:

> On Wed, Apr 24, 2013 at 4:35 AM, Willem Rein Oudshoorn
> <woudshoo at xs4all.nl>wrote:
>
>> Ah, ok, I am a bit struggling to convert the old way to the new way.  It
>> probably has nothing to do with (with-foreign-slots ...), but just my
>> mis understanding and trying to quickly convert old code to new.
>>
>
> Well, there's a bit of unwritten convention being used, so confusion is
> understandable (and I had to think about it and infer what
> with-foreign-slots is intended to do). Before we introduced
> structures-by-value, this wasn't an issue.

Thank you for the clarification

>
> The documentation to
> foreign-slot-pointer<http://common-lisp.net/project/cffi/manual/html_node/foreign_002dslot_002dpointer.html>
>  says
> " ptr
> A pointer to a structure.
> type
> A foreign structure type. "
>
> so it makes sense to me the that first argument is a pointer to a
> structure, and the second argument is the type of that structure (and not
> the type of the first argument, i.e., the pointer type).

Yes, indeed that makes sense.  

Thank you for your explanation.
BTW, is it correct that the documentation is not completely up to date
yet?  The copy I looked at did not decument the :class option to
defcstruct.   I am probably looking at the wrong place :-)

Kind regards,
Wim Oudshoorn.



More information about the cffi-devel mailing list