From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: 2QdxY4RzWzUUiLuE@potatochowder.com Newsgroups: gmane.emacs.help Subject: Re: The addresses used by the loaded variable/function/macro or any symbols. Date: Sun, 26 Sep 2021 04:32:44 -0700 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33169"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sun Sep 26 13:33:31 2021 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mUSPT-0008Rm-I0 for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 26 Sep 2021 13:33:31 +0200 Original-Received: from localhost ([::1]:54114 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mUSPS-0006za-KZ for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 26 Sep 2021 07:33:30 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39844) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <2QdxY4RzWzUUiLuE@potatochowder.com>) id 1mUSOs-0006xT-CT for help-gnu-emacs@gnu.org; Sun, 26 Sep 2021 07:32:56 -0400 Original-Received: from www458.your-server.de ([136.243.165.62]:40356) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <2QdxY4RzWzUUiLuE@potatochowder.com>) id 1mUSOq-0002Vd-Vu for help-gnu-emacs@gnu.org; Sun, 26 Sep 2021 07:32:54 -0400 Original-Received: from sslproxy02.your-server.de ([78.47.166.47]) by www458.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92.3) (envelope-from <2QdxY4RzWzUUiLuE@potatochowder.com>) id 1mUSOp-000DGh-3j for help-gnu-emacs@gnu.org; Sun, 26 Sep 2021 13:32:51 +0200 Original-Received: from [2607:fb90:fc5:480e:8978:1d31:85c:b5bc] (helo=localhost) by sslproxy02.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from <2QdxY4RzWzUUiLuE@potatochowder.com>) id 1mUSOn-0002y9-H0 for help-gnu-emacs@gnu.org; Sun, 26 Sep 2021 13:32:50 +0200 Mail-Followup-To: help-gnu-emacs@gnu.org Content-Disposition: inline In-Reply-To: X-Authenticated-Sender: 2QdxY4RzWzUUiLuE@potatochowder.com X-Virus-Scanned: Clear (ClamAV 0.103.3/26304/Sun Sep 26 11:02:43 2021) Received-SPF: pass client-ip=136.243.165.62; envelope-from=2QdxY4RzWzUUiLuE@potatochowder.com; helo=www458.your-server.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:133254 Archived-At: On 2021-09-26 at 19:11:45 +0800, Hongyi Zhao wrote: > In Python, there is a function named as `id()', which can be used to > check the address of the loaded symbols. I want to know if there is a > similar function in Emacs for this purpose. I don't know about Emacs, but that's not quite what id() does in Python. In Python, id() returns a unique, opaque identifier that identifies a value. That uniqueness, however, is only guaranteed for the lifetime of that value; often, ids are reused over the life of an interpreter instance. As an implementation detail, id() in CPython happens to return the machine address of the value. But id() in Jython returns an integer that's some sort of counter or index into some internal structure. Other implementations have other methods of keeping track of values, but the temporal uniqueness semantic remains the same.