[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: `aset` on strings, changing the size in bytes

From: Eli Zaretskii
Subject: Re: `aset` on strings, changing the size in bytes
Date: Sun, 09 Sep 2018 18:17:47 +0300

> From: Noam Postavsky <address@hidden>
> Date: Sun, 9 Sep 2018 10:44:25 -0400
> Cc: Richard Stallman <address@hidden>, Stefan Monnier <address@hidden>, 
>       Emacs developers <address@hidden>
> On 9 September 2018 at 02:26, Eli Zaretskii <address@hidden> wrote:
> >> Or we could define it to replace a substring:
> >>
> >>    (setq s (srep s from to newsubstring))
> >
> > Why not have aset do this under the hood?  Then we won't need to ask
> > people to change code that worked for decades.
> It's unclear what you mean by that

I meant to make aset cons a new string when it turns out the original
one's data is too small to include the new contents.

> the semantics of aset is to modify the original string, changing
> that would surely break code that worked for decades.

But if we are going to tell people aset won't work in those cases,
that code will be broken as well, no?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]