unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: "Clément Pit-Claudel" <cpitclaudel@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: 31395511: "Don’t attempt to modify constant strings"
Date: Thu, 4 Jun 2020 23:44:59 -0700	[thread overview]
Message-ID: <8ad00be2-c789-df59-92f9-35a3448d51fd@cs.ucla.edu> (raw)
In-Reply-To: <94615cb2-9eda-7c1d-e55c-f89e007cac80@gmail.com>

On 6/4/20 7:09 PM, Clément Pit-Claudel wrote:
> On 04/06/2020 19.10, Paul Eggert wrote:
>>  I don't think this matters much, since string literals shouldn't have
>> text properties.
> 
> Really? I've used the reader syntax for propertized strings a few times — it's pretty convenient.

Oh, you're right. That's a special case for the same reason that the reader
syntax for ordinary string literals is a special case; these strings are constants.

In the implementation that I have in mind, reading the syntax for a propertized
string gives you a string constant, in that the interpreter signals an error if
you try to change the string's characters or its text properties slot - but the
implementation does not prevent you from using setcar or setcdr on the text
properties list. Perhaps some day later we can add further checking to prevent
that sort of funny business on string constants' properties, but one thing at a
time.

If memory serves, it wasn't that long ago that the Elisp interpreter prevented
you from doing that sort of funny business on propertized string constants (at
least when they were in pure space), but we've fallen back a bit on our runtime
checking.



  reply	other threads:[~2020-06-05  6:44 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-03 21:52 31395511: "Don’t attempt to modify constant strings" João Távora
2020-06-03 22:41 ` Paul Eggert
2020-06-03 22:52   ` Pip Cet
2020-06-03 23:20     ` Paul Eggert
2020-06-03 23:20     ` Basil L. Contovounesios
2020-06-03 22:41 ` Pip Cet
2020-06-03 23:08   ` Basil L. Contovounesios
2020-06-03 23:31     ` Basil L. Contovounesios
2020-06-03 23:48   ` João Távora
2020-06-04  0:43     ` Paul Eggert
2020-06-04  1:19       ` Paul Eggert
2020-06-04  7:26         ` Pip Cet
2020-06-04 11:11           ` Basil L. Contovounesios
2020-06-04 19:46             ` Paul Eggert
2020-06-04 20:25               ` João Távora
2020-06-04 20:29                 ` Paul Eggert
2020-06-04 21:21                   ` Drew Adams
2020-06-04 20:43               ` Pip Cet
2020-06-04 21:27                 ` Stefan Monnier
2020-06-04 21:42                   ` Pip Cet
2020-06-04 23:10                 ` Paul Eggert
2020-06-05  2:09                   ` Clément Pit-Claudel
2020-06-05  6:44                     ` Paul Eggert [this message]
2020-06-05 12:44                       ` Stefan Monnier
2020-06-05 17:01                     ` Drew Adams
2020-06-05  9:48                   ` Pip Cet
2020-06-05 18:37                     ` Paul Eggert
2020-06-04 22:33               ` Basil L. Contovounesios
2020-06-05 15:25       ` João Távora
2020-06-05 17:14         ` Dmitry Gutov
2020-06-05 23:19           ` João Távora
2020-06-05 23:32             ` Dmitry Gutov
2020-06-06  1:34               ` FW: " Drew Adams
2020-06-06  0:23             ` Drew Adams
2020-06-06  1:43             ` Paul Eggert
2020-06-06  4:06               ` Richard Stallman
2020-06-06 11:41               ` João Távora
2020-06-06 11:47                 ` João Távora
2020-06-04  4:38     ` Pip Cet
2020-06-04  9:31       ` João Távora

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=8ad00be2-c789-df59-92f9-35a3448d51fd@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=cpitclaudel@gmail.com \
    --cc=emacs-devel@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 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).