A central aspect of the FLI is implementation of foreign language types. FLI variables, function arguments and temporary objects have predictable properties and structures which are analogous to the properties and structures of the types found in C. The FLI can translate Lisp data objects into FLI data objects, which are then passed to the foreign language, such as C. Similarly, data can be passed from C or the Windows functions to the FLI, and then translated into a suitable Lisp form. The FLI types can therefore best be seen as an intermediate stage in the passing of data between Lisp and other languages.
Here are some of the features and sorts of foreign types:
deftype
-like syntax. The macro define-foreign-type provides a simple mechanism for creating parameterized types.
typedef
,
enum
,
struct
, and
union
. The new FLI constructors are define-c-typedef, define-c-enum, define-c-struct and define-c-union. Note that the equivalent foreign types for most standard C types are already available within the FLI.There are two fundamental sorts of FLI types: immediate and aggregate . Immediate types, which correspond to the C fundamental types, are so called because they are basic data types such as integers, booleans and bytes which have a direct representation in the computer memory. Aggregate types, which correspond to the C derived types, consist of a combination of immediate types, and possibly of smaller aggregate types. Examples of aggregate types are arrays and structures. Any user-defined type is an aggregate type.
LispWorks Foreign Language Interface User Guide and Reference Manual - 7 Dec 2011