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

:boolean FLI Type Descriptor

Summary

Converts between a Lisp boolean value and a C representation of a boolean value.

Package

keyword

Syntax

:boolean &optional encapsulates

Arguments
encapsulates
An integral type or :standard.
Description

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.

Examples

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))
See also

size-of
2.1.5 Boolean types


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