Newsgroups: comp.lang.clos
Path: cantaloupe.srv.cs.cmu.edu!bb3.andrew.cmu.edu!newsfeed.pitt.edu!godot.cc.duq.edu!newsgate.duke.edu!news.mathworks.com!news2.cais.net!news.cais.net!news.abs.net!aplcenmp!hall
From: hall@aplcenmp.apl.jhu.edu (Marty Hall)
Subject: Re: Can a programmer get a object id ?
Message-ID: <Dt57Jp.ABC@aplcenmp.apl.jhu.edu>
Organization: JHU/APL Research Center, Hopkins P/T CS Faculty
References: <4ptcoj$9mu@snunews.snu.ac.kr> <s08builhtop.fsf@salmon.ICSI.Berkeley.EDU>
Date: Mon, 17 Jun 1996 11:50:13 GMT
Lines: 23

In article <s08builhtop.fsf@salmon.ICSI.Berkeley.EDU>
marcoxa@salmon.icsi.berkeley.edu (Marco Antoniotti) writes: 
>In article <4ptcoj$9mu@snunews.snu.ac.kr> tschung@papaya.snu.ac.kr
(Tae-Sun Chung) writes: 
[...]
>   >(make-instance 'foo)
>   #<FOO 31446220>
>
>   I guess the number is object id and I want to use it.
>   Is it possible ? How can I get it?
>
>Not very wise.  Usually the number is (or is derived from) the memory
>location of the instance.  Given that some GC move things around you
>are headed for disaster, or, at least, for non-portable code.

But just in case Tae-Sun was unaware, the return value of
MAKE-INSTANCE is a reference (pointer) to the object. You can pass
this reference around and use it, do EQ comparisons on it, etc. (I'm
just speculating that this was why you wanted the object ID).

					- Marty
(proclaim '(inline skates))
<http://www.apl.jhu.edu/~hall/lisp.html>
