All Manuals > LispWorks® User Guide and Reference Manual > 47 The SYSTEM Package

object-pointer Function

Summary

Returns an integer specifying the representation of an object.

Package

system

Signature

object-pointer object => result

Arguments
object
A Lisp object.
Values
result
An integer.
Description

The function object-pointer returns an integer specifying the actual representation of the object object. For most objects, that would be the pointer to it, which is its address (as returned by object-address) plus some tag. Some objects are "immediate" (that is they do not use memory, and immediatep returns t) and for these object-pointer returns the actual address.

The Garbage Collector can move objects, therefore the result of object-pointer is not permanent. It should be used only for debugging.

Notes

The result of object-pointer is what cl:print-unreadable-object uses for the object's "identity". It is normally what appears when using cl:print-unreadable-object with identity t.

Examples
(let ((gf #'make-instance))
  (format t "~a pointer is ~x~%" gf
          (sys:object-pointer gf)))
See also

immediatep
object-address
pointer-from-address


LispWorks® User Guide and Reference Manual - 01 Dec 2021 19:31:02