In this chapter an introduction to some of the FLI functions and types was presented. Some examples demonstrating how to interface LispWorks with Windows and C functions were presented. The first example involved defining a foreign function usingdefine-foreign-function
to call a C function that converts between Farenheit and Celsius. The second involved setting up foreign types, using the FLI macrosfli:define-c-typedef
andfli:define-c-struct
, and defining a foreign function using the FLI macrofli:define-foreign-function
, with which to obtain data from the Windows functionGetCursorPos
. The third example consisted of defining a foreign function to pass data to the Windows functionSetCursorPos
. A further example illustrated how to manage the allocation of memory for creating instances of foreign objects more carefully using the FLI macrofli:with-dynamic-foreign-object
.