From: Eli Zaretskii <eliz@gnu.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 56347@debbugs.gnu.org
Subject: bug#56347: Optimize/simplify STRING_SET_MULTIBYTE
Date: Sat, 02 Jul 2022 21:31:35 +0300 [thread overview]
Message-ID: <83bku7bc3c.fsf@gnu.org> (raw)
In-Reply-To: <jwv1qv3qtwc.fsf-monnier+emacs@gnu.org> (message from Stefan Monnier on Sat, 02 Jul 2022 14:00:41 -0400)
> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Cc: 56347@debbugs.gnu.org
> Date: Sat, 02 Jul 2022 14:00:41 -0400
>
> >> No, I want to reduce the scope of semantics of the macro, e.g. so it can
> >> be implemented as a function rather than a macro and so it doesn't
> >> magically substitute empty_multibyte_string into a variable that held
> >> something else.
> > But the effect is that you disallow calling STRING_SET_MULTIBYTE on an
> > empty string, isn't it?
>
> Yes. In my book, STRING_SET_*IBYTE should basically not exist: a string
> is created as unibyte or multibyte and never changes after that.
That's require a much larger change, I think. It is not enough just
to add an assertion in one place, because that'd just cause
maintenance headaches for no real gain.
And I'm not even sure everyone will agree with such a radical change.
It should be discussed first.
> And indeed because we only have a single copy of the two possible empty
> strings, they can't be changed between unibyte<->multibyte
I can create an empty string without those singletons any time.
next prev parent reply other threads:[~2022-07-02 18:31 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-01 23:32 bug#56347: Optimize/simplify STRING_SET_MULTIBYTE Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-07-02 6:17 ` Eli Zaretskii
2022-07-02 16:12 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-07-02 16:24 ` Eli Zaretskii
2022-07-02 18:00 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-07-02 18:31 ` Eli Zaretskii [this message]
2022-07-02 18:37 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-07-02 18:45 ` Eli Zaretskii
2022-07-02 16:49 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-07-02 17:06 ` Eli Zaretskii
2022-07-02 17:57 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
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=83bku7bc3c.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=56347@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 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).