From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= Newsgroups: gmane.emacs.devel Subject: Re: 31395511: =?utf-8?Q?=22Don=E2=80=99t?= attempt to modify constant strings" Date: Sat, 06 Jun 2020 00:19:02 +0100 Message-ID: <87d06dje3d.fsf@gmail.com> References: <871rmvn7ge.fsf@gmail.com> <87lfl36abx.fsf@gmail.com> <1abe5965-b48e-6dee-1516-c5c233f09d01@cs.ucla.edu> <873679lel3.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="7169"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Paul Eggert , Pip Cet , emacs-devel To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Jun 06 01:19:40 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jhLci-0001mu-JM for ged-emacs-devel@m.gmane-mx.org; Sat, 06 Jun 2020 01:19:40 +0200 Original-Received: from localhost ([::1]:54834 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jhLch-0002zP-Le for ged-emacs-devel@m.gmane-mx.org; Fri, 05 Jun 2020 19:19:39 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35716) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jhLcE-0002W3-Ag for emacs-devel@gnu.org; Fri, 05 Jun 2020 19:19:10 -0400 Original-Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]:36817) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jhLcC-00058c-RA for emacs-devel@gnu.org; Fri, 05 Jun 2020 19:19:09 -0400 Original-Received: by mail-wr1-x436.google.com with SMTP id q11so11306232wrp.3 for ; Fri, 05 Jun 2020 16:19:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=k8tYok/skZbOsxkFP/iMN2XrcK+xwamBsI1lpgsjlRA=; b=j/Lj+BZQUBoa7929x8WkOJGvQFch9h7wGzAqcoOpJtsX1fd5hrFU1rVW91O5otbYeE WXjXzOypZbXIoExunEVleHPZgW5PSuveCrwFGSCNALhHOgJBqS1Tu3OcqRVqQ2u6darw StL3eNreAKHVwqtBMe2wU0zZUmxbCekLzdePABUNTwtukuhSZffVpkZd7BfSSwDSmQmn FB+rG8u5hoBccIRVhDNaq3LPMIuneSDCFFVmU6g6s97VBoZC98V7jrH/Ldez4ZXsUwT4 9UDlK93nlD/y/QSyRD8eaFjRYEN+5EQFb8g5PB9VSGA6mAyS3zslHi1mRLMwU/DdeJlX 4Y5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=k8tYok/skZbOsxkFP/iMN2XrcK+xwamBsI1lpgsjlRA=; b=ZsYL4+N0QgSmnGB0U23/EEHURgz0Gz0utzfzHDxcYLS9WZ6reoeOHw7l5Ma3gVWO4z 62FcNa7cBv+yK44HK6/JTQodCbFmWcB5yiiQa+z03Xp+lkDKZgqIAilUDg8rQjKGYk+/ qfGueeoKQiO/oe0hLbNXHOWJYfS8r3jYERPJ+vMDtJfElrMPQxA711zqqacvm9V3HmfS iuMhJY7nvCfCYDMiKkGEhF23F5h+zENtmzQniNbUPSfZgkQ+EmbHI8KJfIMe8rXtypJI fQP1nk3O9O3d29Hpy14VFuZJYPA9yo1tK654FDQHnilN+5WSaUxGmrGzSQKtHAQX4WKe AJDw== X-Gm-Message-State: AOAM531jDqNXh4/Muxb7CBU4Q7I0/8aIBz4i0f4hDsxN21ThrKy0eqlW XTf/UkgbNkjzgDjPhy9VfW7DLXm7TMQ= X-Google-Smtp-Source: ABdhPJx9RdiLdF5FJGOpDItcL5VHu0rR0hi01Thdmf0Siy7F2dsxpyUjYqwqQsnxFjQM931k4AwRuA== X-Received: by 2002:a5d:4008:: with SMTP id n8mr11591626wrp.82.1591399146746; Fri, 05 Jun 2020 16:19:06 -0700 (PDT) Original-Received: from krug ([89.180.147.39]) by smtp.gmail.com with ESMTPSA id l204sm13451824wmf.19.2020.06.05.16.19.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jun 2020 16:19:05 -0700 (PDT) In-Reply-To: (Dmitry Gutov's message of "Fri, 5 Jun 2020 20:14:12 +0300") Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=joaotavora@gmail.com; helo=mail-wr1-x436.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, FROM_EXCESS_BASE64=0.979, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:251920 Archived-At: Dmitry Gutov writes: > FWIW, it's a non-intuitive limitation for me as well. > > But you can give bug#40671 a read, so see some context you might be missi= ng. Thanks, that's a pretty long read. There is indeed a relation, but that bug (the first parts) is about modifying literal objects and this particular strangeness seems bigger than that. I totally agree it is undefined behaviour to change structure of literals (quoted or self-evaluating objects), also in Common Lisp, because compilers are probably allowed to reuse parts of the internal structure of such objects. But that's a far cry from having two different manifestations of `equal` such objects _be_ the same object, but only for compiled code. Emacs doesn't behave that way for quoted lists (fortunately), so I don't think it should behave that way for strings either. An "easy" solution would be to say: in Elisp, there are no string literals, period, because properties. But that's likely expensive... unless some clever copy-on-write semantics operate under the hood. But I'm talking out of my elbow, I don't really know what's under the hood here. Jo=C3=A3o