From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Hongyi Zhao Newsgroups: gmane.emacs.help Subject: Re: The addresses used by the loaded variable/function/macro or any symbols. Date: Sun, 26 Sep 2021 20:00:06 +0800 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23172"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sun Sep 26 14:04:49 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 1mUStl-0005l3-HS for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 26 Sep 2021 14:04:49 +0200 Original-Received: from localhost ([::1]:45318 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mUSti-0006Gz-9a for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 26 Sep 2021 08:04:46 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45254) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mUSpQ-0006ES-Lx for help-gnu-emacs@gnu.org; Sun, 26 Sep 2021 08:00:24 -0400 Original-Received: from mail-ua1-x932.google.com ([2607:f8b0:4864:20::932]:40702) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mUSpO-0005jK-CE for help-gnu-emacs@gnu.org; Sun, 26 Sep 2021 08:00:19 -0400 Original-Received: by mail-ua1-x932.google.com with SMTP id i8so7943430uae.7 for ; Sun, 26 Sep 2021 05:00:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=fZ2gNop7BNMdE5SWXXQqEJv4v+PcLlELlsvfKD30yvI=; b=Nx73qKIfX2qqwtcLIWvjB0P/c4LCKCABRZXohv7PNS9GSS2N+fi6JeFf+sQjL0fc14 DYBmzkEm2gZtqo2fa8WhxDOIBouVh0EIl8dn6CoYwrc0f8+II9tLOmQdKa5z1ft53jGw TKzZ5/bY6rx+5A4U26h4XsnsUYSxrG1/KN+DELWMTRrK5hgGBcjYsqJffKgTC6GB68uA 1+mAo4YRHARngxUnuwMQumYLTEO72b2v1lVoX/MhxBcYaQJNBMtvBP/uCtLZ9CtYiwUi om8RX8v07FpwjVsvvh49LEQOZI4ngU4O0BC1qQEsIFYRVGNYm+omYR/56ajsyLX+lVBB DqcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=fZ2gNop7BNMdE5SWXXQqEJv4v+PcLlELlsvfKD30yvI=; b=qqjFUmuFbKbZ+nsTxQUextWejxhHKgbR48LmtxkGtr2ayhfa5q1YK0CkPPhPzdsGeg jSzh9T5iOl0V+pddVN7/afq3ctmg15mcSzJrphDL/dDTWJ50R8qs7otng1W7wpMHgfvO d2qsxboOyBzCXf+jlmi3q9J6T1Xp0JpPt/CfrcpQg4/RfguDVtFegnz47txn6OzkCAr4 t66lv+nynh4qnd+sDrwmTulFd4ZipEKi6QWyL2LKmINO7zFS1t2X3lIY9dUiLOFCvkWs 17R1iKR8SpXTU8+ZY14qDPgpiy3MgUqpZFjJHWtPD8cE/g0Krb1OkN9aRHn/bpIh05FU 8K3g== X-Gm-Message-State: AOAM533wOfmz0PmtmhAI3lKnNviVKwaDp2u9WXxTWcwl5sWK9bJUHRBH LD8S0D2i1K5XF3eTMadKIZtApcMHqToteOC5uuK1rSPZyJBOp6mV X-Google-Smtp-Source: ABdhPJwk/fLCKQ5LSM+hQfIS6eEoYnoXOIfN0YjdAxz/8Baxsfz8PbQ0OFEfZMmmOBLSA6VA2lTB93MPR5wPVd1Qnxo= X-Received: by 2002:a05:6130:392:: with SMTP id az18mr16574453uab.71.1632657617237; Sun, 26 Sep 2021 05:00:17 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::932; envelope-from=hongyi.zhao@gmail.com; helo=mail-ua1-x932.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 5.0 requ) BAYES_05=-0.5, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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:133259 Archived-At: On Sun, Sep 26, 2021 at 7:33 PM <2QdxY4RzWzUUiLuE@potatochowder.com> wrote: > > 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. Thank you for your systematic and thorough explanation. These conclusions cannot be drawn by built-in help alone, as shown below: In [1]: id? Signature: id(obj, /) Docstring: Return the identity of an object. This is guaranteed to be unique among simultaneously existing objects. (CPython uses the object's memory address.) Type: builtin_function_or_method Best, HZ