All Manuals > Foreign Language Interface User Guide and Reference Manual > 8 Type Reference

:enum

:enumeration FLI Type Descriptors

Summary

Converts between a Lisp symbol and a C enum.

Package

keyword

Syntax

:enum &rest enum-constants

:enumeration &rest enum-constants

enum-constants ::= {entry-name | (entry-name entry-value)}*

Arguments
enum-constants
A sequence of one or more symbols naming the elements of the enumeration.
entry-name
A symbol naming an element of the enumeration.
entry-value
An integer specifying the value of entry-name.
Description

The FLI type :enum converts between a Lisp symbol and the C enum type. Each entry in enum-constants can either consist of a symbol entry-name, in which case the first entry has a value 0, or of a list of a symbol entry-name and its corresponding integer value entry-value.

:enumeration is a synonym for :enum.

Examples

See define-c-enum, for an example using the :enum type.

See also

define-c-enum
2.1.1 Integral types


Foreign Language Interface User Guide and Reference Manual - 01 Dec 2021 19:34:59