Subject: Re: sxhash and object identity
From: rpw3@rpw3.org (Rob Warnock)
Date: Tue, 22 Nov 2005 03:58:59 -0600
Newsgroups: comp.lang.lisp
Message-ID: <NOGdnfzZ87l-dh_eRVn-iw@speakeasy.net>
Andrew Philpot  <philpot@isi.edu> wrote:
+---------------
| This is old, non-portable and incomplete.  ...
...
| (defun object-internal-pointer (object)
|   "Given an arbitrary object, return an integer (should be fixnum in
| many cases, unknown how Xerox and Gold Hill deal with this) which is
| unique to that object, generally its actual pointer address"
|   (flet ((abut (x y)
| 	   (+ y (* x (expt 10 (1+ (floor (log y 10))))))))
|     #+CMU	0
...
+---------------

You can change the CMUCL entry to this:

      #+cmu	(kernel:get-lisp-obj-address object)

though be advised that due to the way CMUCL handles the memory
mapping for its heap, the result will probably be a FIXNUM only
for "small immediates", e.g.:

    > (mapcar #'kernel:get-lisp-obj-address '(37 #\A 23.4 foo (bar) t nil))

    (148 16806 1487569263 1486380807 1487569307 671088679 671088651)
    > (mapcar #'fixnump *)

    (T T NIL NIL NIL NIL NIL)
    > 


-Rob

-----
Rob Warnock			<rpw3@rpw3.org>
627 26th Avenue			<URL:http://rpw3.org/>
San Mateo, CA 94403		(650)572-2607