From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Lars Brinkhoff Newsgroups: gmane.emacs.help Subject: Re: Object identity Date: 21 Oct 2003 19:42:35 +0200 Organization: nocrew Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <85oewaa3n8.fsf@junk.nocrew.org> References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1066758707 3902 80.91.224.253 (21 Oct 2003 17:51:47 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 21 Oct 2003 17:51:47 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Oct 21 19:51:45 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 1AC0fY-0005u2-00 for ; Tue, 21 Oct 2003 19:51:44 +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 1AC0fS-00051z-FY for geh-help-gnu-emacs@m.gmane.org; Tue, 21 Oct 2003 13:51:38 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1AC0ev-00050V-0A for help-gnu-emacs@gnu.org; Tue, 21 Oct 2003 13:51:05 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1AC0eM-0004cN-Om for help-gnu-emacs@gnu.org; Tue, 21 Oct 2003 13:51:01 -0400 Original-Received: from [80.91.224.249] (helo=main.gmane.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AC0eL-0004bj-Iq for help-gnu-emacs@gnu.org; Tue, 21 Oct 2003 13:50:29 -0400 Original-Received: from root by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1AC0eK-0003EU-00 for ; Tue, 21 Oct 2003 19:50:28 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-To: help-gnu-emacs@gnu.org Original-Received: from sea.gmane.org ([80.91.224.252]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AC0Wi-00039W-00 for ; Tue, 21 Oct 2003 19:42:36 +0200 Original-Received: from news by sea.gmane.org with local (Exim 3.35 #1 (Debian)) id 1AC0Wi-0000hY-00 for ; Tue, 21 Oct 2003 19:42:36 +0200 Original-Lines: 30 Original-X-Complaints-To: usenet@sea.gmane.org User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 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:13430 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:13430 Barry Margolin writes: > Lars Brinkhoff wrote: > >Is there a function, say object-identity, in Emacs Lisp that maps an > >object to a unique value (other than the object itself)? For example, > >the value could be an integer, or a list of integers, or a string, > >that represents the memory address of the object. > I'm not sure it's possible to write such a function without significant > overhead. Right, I didn't consider that garbage collection (in general) can move things around. Stefan Monnier writes: > > The OP explained what it's useful for: emulating weak hash tables in a > > system that doesn't have them built in. > That's not how I understood his article. He seemed to say that he > currently uses an implementation of object-identity which relies on > a weak hash-table but that his Emacs's doesn't implement weakness. Right, that's what I meant. > I.e. he seemed to say he needed weak hash-tables to implement > oject-identity, not the other way around. Well, either I need weak hash tables, or a different implementation of object-identity. -- Lars Brinkhoff, Services for Unix, Linux, GCC, HTTP Brinkhoff Consulting http://www.brinkhoff.se/