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

NextPrevUpTopContentsIndex

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

If pointer1 points to the same address as pointer2, pointer-eq returns t, otherwise it returns nil.

Description

The function pointer-eq tests whether two pointers point to the same address, and returns t if they do, and nil if they do not.

Example

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

Pointer testing functions
null-pointer-p
pointerp


LispWorks Foreign Language Interface User Guide and Reference Manual - 16 Feb 2015

NextPrevUpTopContentsIndex