From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: 26629@debbugs.gnu.org, Tobias Zawada <i@tn-home.de>
Subject: bug#26629: 25.1.50; Feature-request: Structure-preserving copying of sequences
Date: Fri, 13 May 2022 13:47:53 -0400 [thread overview]
Message-ID: <jwv8rr5jpmx.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <87ee0x1k5a.fsf@gnus.org> (Lars Ingebrigtsen's message of "Fri, 13 May 2022 18:18:09 +0200")
> I haven't looked closely at the code, but this is functionality that I
> vaguely remember having been requested before, and I don't think Emacs
> has it yet? (But I may be wrong about that.)
> I've added Stefan to the CCs; perhaps he has some comments.
My opinion is rather negative: IMO `copy-tree` itself is a bad function
in the sense that it's (almost) never really right, IOW most uses of
`copy-tree` are fundamentally quick hacks which happen to work most of
the time because the details of when to recurse and when not to very
rarely map exactly to "recurse on `cons` and only `cons`".
So rather than `copy-tree*` I'd rather see some kind of generic
`deep-copy` function which takes a (or some) parameter(s) that indicates
when (and potentially how) to copy/recurse each of the elements (where
`deep-copy`s job would thus be mainly to take care of maintaining the
hash-map and maybe using an explicit stack to avoid deep recursion).
Stefan
next prev parent reply other threads:[~2022-05-13 17:47 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-23 22:02 bug#26629: 25.1.50; Feature-request: Structure-preserving copying of sequences Tobias Zawada
2022-05-13 16:18 ` Lars Ingebrigtsen
2022-05-13 17:47 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2022-05-14 2:18 ` Lars Ingebrigtsen
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwv8rr5jpmx.fsf-monnier+emacs@gnu.org \
--to=bug-gnu-emacs@gnu.org \
--cc=26629@debbugs.gnu.org \
--cc=i@tn-home.de \
--cc=larsi@gnus.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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).