A foreign object, or a pointer to a foreign object.
A symbol or a list of symbols identifying the slot to be accessed, as described for foreign-slot-value.
The type of the slot slot-name .
The FLI structure type that contains slot-name . If this is passed, the compiler might be able to optimize the access to the slot. If this is omitted, the object type is determined dynamically from object .
In the following example a structure type called
is defined. An instance of the structure is allocated using
is used to get a pointer, called
, to the second slot of the foreign object.
keyword can be used to return the value stored in the slot as a different type, providing the type is compatible. In the next example,
is set to be a pointer to the same address as
, but it expects the value stored there to be a boolean.
Using dereference the value can be set as an integer using
and read as a boolean using
(setf (fli:dereference point2) 0)
(setf (fli:dereference point2) 1)
LispWorks Foreign Language Interface User Guide and Reference Manual - 7 Dec 2011