All Manuals > Foreign Language Interface User Guide and Reference Manual > 7 Function, Macro and Variable Reference

with-integer-bytes Macro

Summary

Converts a Lisp integer to foreign bytes while executing a body of code.

Package

fli

Signature

with-integer-bytes (pointer length) integer &body body => last

Arguments
pointer
A variable to be bound to the foreign pointer.
length
A variable to be bound to the length in bytes.
integer
An integer.
body
Forms to be executed.
Values
last
The value of the last form in body.
Description

The macro with-integer-bytes evaluates the forms in body with pointer bound to a dynamic foreign object containing the bytes of integer and length bound to the number of bytes in that object. The layout of the bytes is unspecified, but the bytes and the length are sufficient to reconstruct integer by calling make-integer-from-bytes.

See also

5.3 Lisp integers
convert-integer-to-dynamic-foreign-object
make-integer-from-bytes


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