Next: , Up: Alien Types   [Contents][Index]

8.2.1 Defining Alien Types

Types may be either named or anonymous. With structure and union types, the name is part of the type specifier, allowing recursively defined types such as:

(struct foo (a (* (struct foo))))

An anonymous structure or union type is specified by using the name nil. The with-alien macro defines a local scope which “captures” any named type definitions. Other types are not inherently named, but can be given named abbreviations using def-alien-type.

Macro: alien:def-alien-type name type

This macro globally defines name as a shorthand for the Alien type type. When introducing global structure and union type definitions, name may be nil, in which case the name to define is taken from the type’s name.