From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Barry Margolin Newsgroups: gmane.emacs.help Subject: Re: Object identity Date: Tue, 21 Oct 2003 19:27:03 GMT Organization: Level(3) Communications, Woburn, MA Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1066764769 17507 80.91.224.253 (21 Oct 2003 19:32:49 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 21 Oct 2003 19:32:49 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Oct 21 21:32:47 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AC2FK-0004N3-00 for ; Tue, 21 Oct 2003 21:32:46 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AC2Ed-0007ZP-Hv for geh-help-gnu-emacs@m.gmane.org; Tue, 21 Oct 2003 15:32:03 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!bloom-beacon.mit.edu!nycmny1-snh1.gtei.net!crtntx1-snh1.gtei.net!news.gtei.net!news.level3.com.POSTED!53ab2750!not-for-mail Original-Newsgroups: gnu.emacs.help Mail-Copies-To: never X-Newsreader: trn 4.0-test72 (19 April 1999) Originator: barmar@genuity.net (Barry Margolin) Original-Lines: 28 Original-NNTP-Posting-Host: 171.78.176.30 Original-X-Trace: news.level3.com 1066764423 171.78.176.30 (Tue, 21 Oct 2003 19:27:03 GMT) Original-NNTP-Posting-Date: Tue, 21 Oct 2003 19:27:03 GMT Original-Xref: shelby.stanford.edu gnu.emacs.help:117502 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:13433 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:13433 In article , Lars Brinkhoff wrote: >Stefan Monnier writes: >> > Is there a function, say object-identity, in Emacs Lisp that maps an >> > object to a unique value (other than the object itself)? >> I'm wondering what you want it for. > >In the implementation of Common Lisp's print-unreadable-object when >:identity t is supplied. AFAIK, there's no guarantee that the same object will print identically over time. Most implementations just display the object's current address; if the GC moves it, the next time it's printed it will be different. And it's also possible for two different objects to display identically; in between the two PRINT-UNREADABLE-OBJECT calls the GC could copy one of them into the location that the other one used to occupy. Anyway, there's a reason why Common Lisp requires that PRINT-UNREADABLE-OBJECT be built into the implementation. We didn't want to expose an interface to getting these not-quite-unique identifiers. They're not much use for anything other than this one function; if we provided the API, users would undoubtedly misuse it. -- Barry Margolin, barry.margolin@level3.com Level(3), Woburn, MA *** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups. Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.