[Cffi-devel] Still can't mem-aref the output of a metaobject with provided code

Willem Rein Oudshoorn woudshoo at xs4all.nl
Sun May 11 09:10:19 UTC 2014


Joeish W <joeish80829 at yahoo.com> writes:

[SKIPPED CODE]
>
> When I run (defparameter a (%scalar 1d0 2d0 3d0 4d0))  and (mem-aref a :double)  I still get:
>
> The value #<CV-SCALAR {10046BC833}>
> is not of type
>   SB-SYS:SYSTEM-AREA-POINTER.
>
> but when I run  (mem-aref (c-pointer a) :double)  it works.
>
> What do I have to change in my types so I can mem-aref  "A" normally, like this 
>
> (mem-aref a :double)...Any help is much appreciated:)

Did you read the tutorial and the CFFI manual?

To be short, you should only use the mem-aref in lowlevel code and in
that case you are better of using the (mem-aref (c-pointer ...))
construct.

However if you want to expose the members of the C++ class instance you 
should lookup the defcstruct documentation in the CFFI manual.

Wim Oudshoorn





More information about the cffi-devel mailing list