Either an instance of or a pointer to a FLI structure.
A symbol or a list of symbols identifying the slot to be accessed.
The type of value. Specifying type makes accessing the object faster. If the specified type is different to the actual type,
foreign-slot-value returns the value in the format of type where possible.
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.
foreign-slot-value returns the value of a slot in a specified object. An error is signaled if the slot is an aggregate type and copy-foreign-object is not set accordingly. Use foreign-slot-pointer to access such aggregate slots.
If slot-name is a symbol then it names the slot of object to be accessed. If slot-name is a list of symbols, then these symbols name slots in nested structures starting with the outermost structure object, as in the
outer example below.
64-bit integer types such as
are now supported for type in
foreign-slot-value in 32-bit LispWorks. In 32-bit LispWorks 6.1 and earlier versions, these types could only be used by define-foreign-function.
In the following example a foreign structure is defined, an instance of the structure is made with
my-pos pointing to the instance, and
foreign-slot-value is used to set the
y slot of the object to 10.
(setq my-pos (fli:allocate-foreign-object :type 'POS))
(setf (fli:foreign-slot-value my-pos 'y) 10)
(fli:foreign-slot-value my-pos 'y)
(fli:foreign-slot-value my-pos 'y :object-type 'pos)
LispWorks Foreign Language Interface User Guide and Reference Manual - 16 Feb 2015