LispWorks Foreign Language Interface User Guide and Reference Manual > 3 FLI Pointers > 3.1 Creating and copying pointers

NextPrevUpTopContentsIndex

3.1.2 Copying pointers

Suppose the Lisp variable point3 is bound to a FLI pointer as in Creating pointers. To make a copy of the pointer it is not sufficient to do the following:

(setq point4 point3)

This simply sets point4 to contain the same pointer object as point3 . Thus if the pointer is changed using point3 , a similar change is observed when looking in point4 . To create a distinct copy of the pointer object you should use copy-pointer, which returns a new pointer object with the same address and type as the old one, as the following example shows.

(setq point5 (fli:copy-pointer point3))
LispWorks Foreign Language Interface User Guide and Reference Manual - 21 Dec 2009

NextPrevUpTopContentsIndex