4.1.2 Creating foreign structure types

4.1.2.1 Foreign types

A foreign type is a set of abstract attributes of an area in memory that specifies how the bits stored in the area are to be interpreted. The compiler uses these attributes to determine how to expand certain expressions--assignment statements, for example. A location in memory that can be used by foreign code and that is associated with a foreign type is known as foreign storage. As an example, the foreign type:signed-32bit defines a correspondence between the Lisp data typeinteger and the C data typelong. If 32 bits of foreign storage are assigned for the foreign typelong, Lisp has predefined access and update functions to convert these bits to and from Lisp objects of typeinteger.

Procedural languages such as C associate foreign storage with the term variable; however, that term is used differently in Lisp. The Foreign Function Interface calls foreign storage that has a name a foreign variable.

The foreign type system supports both named types and derived types:


The Advanced User's Guide - 9 SEP 1996

Generated with Harlequin WebMaker