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

pointer-eq Function

Summary

Test whether two pointers point to the same memory address.

Package

fli

Signature

pointer-eq pointer1 pointer2 => boolean

Arguments
pointer1
A FLI pointer.
pointer2
A FLI pointer.
Values
boolean
A boolean.
Description

The function pointer-eq tests whether pointer1 points to the same address as pointer2 and returns t if they do, and nil if they do not.

Examples

In the following example a pointer, point1, is defined, and point2 is set equal to it. Both are then tested to see if they are equal to each other using pointer-eq. Then point2 is defined to point to a different object, and the two pointers are tested for equality again.

(setq point1 (fli:allocate-foreign-object :type :int))
(setq point2 point1)
(fli:pointer-eq point1 point2)
(setq point2 (fli:allocate-foreign-object :type :int))
(fli:pointer-eq point1 point2)
See also

3.2 Pointer testing functions
null-pointer-p
pointerp


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