I was on google about, oh, 3 hours looking for a solution to this "problem". I am trying to figure out how to instantiate a C structure in lisp using CFFI. I have a structure in c:
struct cpVect{cpFloat x,y;}
Simple? I have automatically created CFFI bindings (swig, I think) to this structure:
(cffi:defcstruct #.(chipmunk-lispify "cpVect" 'classname)
(#.(chipmunk-lispify "x" 'slotname) :double)
(#.(chipmunk-lispify "y" 'slotname) :double))
This creates a "VECT" structure with slots: X and: Y that confirm the names of foreign slots (note that I did not generate bindings or program the C library (chipmunk physics), but the actual functions are called from lisp just fine).
I searched around the world, and maybe I saw it 100 times and hush it up, but I can't figure out how to instantiate cpVect in lisp for use in other functions.
Pay attention to the function:
cpShape *cpPolyShapeNew(cpBody *body, int numVerts, cpVect *verts, cpVect offset)
cpVect, cpVects, : ?
http://common-lisp.net/project/cffi/manual/html_node/defcstruct.html , "Error: Unbound variable: PTR" ( Clozure CL), , , .
lisp, , , , . !