enum-symbol-value enum-type symbol => value
enum-value-symbol enum-type value => symbol
enum-values enum-type => values
The function enum-symbol-value
returns the value value of symbol symbol in the FLI enumerator type enum-type, or nil
if enum-type does not contain symbol.
The function enum-value-symbol
returns the symbol symbol in the FLI enumerator type enum-type at value value, or nil
if value is out of range for enum-type.
The functions enum-values
, enum-symbols
and enum-symbol-value-pairs
respectively return a list of the values, symbols and pairs for the enum-type, where a pair is a cons of symbol and value.
enum-type must be defined by define-c-enum.
(fli:define-c-enum colors red green blue)
=>
(:ENUM COLORS)
(fli:enum-symbol-value 'COLORS 'red)
=>
0
(fli:enum-value-symbol 'COLORS 0)
=>
RED
(fli:define-c-enum half_year (jan 1) feb mar apr may jun)
=>
(:ENUM HALF_YEAR)
(fli:enum-symbol-value 'HALF_YEAR 'feb)
=>
2
(fli:enum-value-symbol 'HALF_YEAR 2)
=>
FEB
(fli:enum-symbol-value-pairs 'HALF_YEAR)
((JAN . 1) (FEB . 2) (MAR . 3) (APR . 4) (MAY . 5) (JUN . 6))
LispWorks Foreign Language Interface User Guide and Reference Manual - 29 Sep 2017