From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Re: `aset` on strings, changing the size in bytes Date: Mon, 10 Sep 2018 01:48:19 -0400 Message-ID: References: <88must56x4.fsf@gnu.org> <83efe4trsa.fsf@gnu.org> <83lg8bsvfm.fsf@gnu.org> <83in3fqj9c.fsf@gnu.org> Reply-To: rms@gnu.org NNTP-Posting-Host: blaine.gmane.org Content-Type: text/plain; charset=Utf-8 X-Trace: blaine.gmane.org 1536559154 16409 195.159.176.226 (10 Sep 2018 05:59:14 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 10 Sep 2018 05:59:14 +0000 (UTC) Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Sep 10 07:59:10 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fzFE5-0004B7-Ul for ged-emacs-devel@m.gmane.org; Mon, 10 Sep 2018 07:59:10 +0200 Original-Received: from localhost ([::1]:49893 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fzFGC-00086R-A7 for ged-emacs-devel@m.gmane.org; Mon, 10 Sep 2018 02:01:20 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56011) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fzFEy-0007GB-5Z for emacs-devel@gnu.org; Mon, 10 Sep 2018 02:00:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fzF3e-0007nC-0p for emacs-devel@gnu.org; Mon, 10 Sep 2018 01:48:23 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:57977) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fzF3b-0007kZ-CD; Mon, 10 Sep 2018 01:48:19 -0400 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1fzF3b-0003Bd-6B; Mon, 10 Sep 2018 01:48:19 -0400 In-Reply-To: <83in3fqj9c.fsf@gnu.org> (message from Eli Zaretskii on Sun, 09 Sep 2018 09:26:07 +0300) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:229590 Archived-At: [[[ To any NSA and FBI agents reading my email: please consider ]]] [[[ whether defending the US Constitution against all enemies, ]]] [[[ foreign or domestic, requires you to follow Snowden's example. ]]] > > (setq s (srep s from to newsubstring)) > Why not have aset do this under the hood? aset, with its current specification, cannot do this because there is no way to replace the old string (as a Lisp object) with a new string. Currently a string object points to a separate string text. That enables aset to replace the old string text with a new string text. If we wanted to change the string representation, that might become impossible. That might cause problems in places that uses aset. I propose srep because some of those places might use srep instead. -- Dr Richard Stallman President, Free Software Foundation (https://gnu.org, https://fsf.org) Internet Hall-of-Famer (https://internethalloffame.org)