
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 using define-foreign-function to call a C function that converts between Farenheit and Celsius. The second involved setting up foreign types, using the FLI macros fli:define-c-typedef and fli:define-c-struct , and defining a foreign function using the FLI macro fli:define-foreign-function , with which to obtain data from the Windows function GetCursorPos . The third example consisted of defining a foreign function to pass data to the Windows function SetCursorPos . A further example illustrated how to manage the allocation of memory for creating instances of foreign objects more carefully using the FLI macro fli:with-dynamic-foreign-object .