Converts between a Lisp boolean value and a C representation of a boolean value.
keyword
:boolean &optional encapsulates
| encapsulates⇩ |
An integral type or :standard. |
The FLI type :boolean converts between a Lisp boolean value and a C representation of a boolean value. encapsulates specifies the size of the value from which the boolean value is obtained, which defaults to :int. For example, if a byte is used in C to represent a boolean, the size to map across for the FLI will be one byte, but if an int is used, then the size will be four bytes. If encapsulates is :standard, then the type maps to the _Bool type in the C99 language definition.
A value of 0 in C represents a nil boolean value in Lisp, and a non-zero value in C represents a t boolean value in Lisp.
In the following three examples, the size of a :boolean, a (:boolean :int) and a (:boolean :byte) are returned.
(fli:size-of :boolean)
(fli:size-of '(:boolean :int))
(fli:size-of '(:boolean :byte))
Foreign Language Interface User Guide and Reference Manual - 01 Dec 2021 19:34:59