all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: 2QdxY4RzWzUUiLuE@potatochowder.com
To: help-gnu-emacs@gnu.org
Subject: Re: The addresses used by the loaded variable/function/macro or any symbols.
Date: Sun, 26 Sep 2021 04:32:44 -0700	[thread overview]
Message-ID: <YVBaXNR+wwaPXNnh@scrozzle> (raw)
In-Reply-To: <CAGP6POLX4e808UUJJNtd7Hb3fi7HpKctAavQTkW3fLjxNy4yKA@mail.gmail.com>

On 2021-09-26 at 19:11:45 +0800,
Hongyi Zhao <hongyi.zhao@gmail.com> 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.



  reply	other threads:[~2021-09-26 11:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-26 11:11 The addresses used by the loaded variable/function/macro or any symbols Hongyi Zhao
2021-09-26 11:32 ` 2QdxY4RzWzUUiLuE [this message]
2021-09-26 12:00   ` Hongyi Zhao
2021-09-26 12:16     ` 2QdxY4RzWzUUiLuE

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YVBaXNR+wwaPXNnh@scrozzle \
    --to=2qdxy4rzwzuuilue@potatochowder.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.