all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 70368@debbugs.gnu.org
Subject: bug#70368: [PATCH] Use a dedicated type to represent interpreted-function values
Date: Mon, 15 Apr 2024 16:10:07 +0300	[thread overview]
Message-ID: <86cyqqlqkw.fsf@gnu.org> (raw)
In-Reply-To: <jwv7cgyvn7r.fsf-monnier+emacs@gnu.org> (message from Stefan Monnier on Mon, 15 Apr 2024 08:22:10 -0400)

> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Cc: 70368@debbugs.gnu.org
> Date: Mon, 15 Apr 2024 08:22:10 -0400
> 
> > I think the only problems we need to mention are those with Lisp
> > programs that "dig" inside the code of functions.  I think it should
> > be enough to give one or two concrete examples (what internals the
> > offending code depended on), and tell that these techniques will no
> > longer work.  You mention above examples of packages that used to do
> > it, but that's not useful; providing specific examples of what those
> > packages did will explain the problems much better.
> 
> There's nothing very special about it: `car/cdr` on an interpreted
> function will fail because it's not represented as a list any more.
> You can still extract the various subparts with `aref`, tho.
> 
> >> How do you imagine a user or developer is going to make use of the
> >> above info?
> > They will realize which techniques are no longer supposed to work, and
> > could look into their code to try find such techniques.
> 
> The "techniques" that won't work any more are any and all accesses to
> a function via `car/cdr` (and derivatives, like `assq`), but that should
> be immediately obvious from:
> 
>     Instead of representing interpreted functions as lists that start
>     with either 'lambda' or 'closure', Emacs now represents them as
>     objects of their own 'interpreted-function' type, which is very
>     similar to 'byte-code-function' objects (the argument list,
>     docstring, and interactive forms are placed in the same slots).

So how about adding after the above just this single sentence:

  Thus code that attempts to "dig" into the internal structure of
  an interpreted function's object with the likes of 'car' or 'cdr'
  will no longer work (but 'aref' will still work to extract its
  various subparts).

> > Then maybe a defalias with a suitable name could be the first step in
> > that direction?
> >
> > I suggested documenting it because the name of the function no longer
> > describes accurately what it does, and people might be surprised to
> > see that it is used to create something other than byte-code.
> 
> Hmm... I'll see what I can come up with,

Thanks.





  reply	other threads:[~2024-04-15 13:10 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-13 19:56 bug#70368: [PATCH] Use a dedicated type to represent interpreted-function values Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-14  5:32 ` Eli Zaretskii
2024-04-14 13:49   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-14 14:45     ` Eli Zaretskii
2024-04-14 23:03       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-15 11:23         ` Eli Zaretskii
2024-04-15 12:22           ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-15 13:10             ` Eli Zaretskii [this message]
2024-04-18 16:36               ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-18 16:49                 ` Eli Zaretskii
2024-04-28 16:05                   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-29  9:05                     ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-29 17:15                       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-29 11:38                     ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-29 17:18                       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-29 17:30                         ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-30 12:49                         ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-30 13:51                           ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-30 15:02                             ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-30 15:19                             ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-30 18:34                               ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-01 12:35                                 ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-14 16:18     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-14 19:11       ` Eli Zaretskii

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=86cyqqlqkw.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=70368@debbugs.gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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.