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

:int-boolean FLI Type Descriptor

Summary

Converts between Lisp boolean and C int.

Package

keyword

Syntax

:int-boolean

Description

The FLI type :int-boolean converts between a Lisp boolean and a C int. Lisp nil is converted to 0 in C, and a non-nil value is converted to 1 in C. 0 in C is converte to nil, and any other value in C is converted to t.

Notes

:int-boolean is intended to be used in "old" C where conceptual booleans are declared int. For example, the C function isatty returns an int, but conceptually it is a boolean.

If the C type is _Bool (or bool when the stdbool.h header is included), then you should use :bool instead of :int-boolean.

See also

:boolean
:bool
2.1.5 Boolean types


Foreign Language Interface User Guide and Reference Manual - 18 Feb 2025 15:36:34