[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 09:26:07 +0300 |
> From: Richard Stallman <address@hidden>
> Cc: address@hidden, address@hidden
> Date: Sun, 09 Sep 2018 02:07:15 -0400
>
> > But if I'm mistaken, and the current implementation does cons a new
> > string, then what is your problem with it? The original string is not
> > mutable, it's just replaced wit ha new one.
>
> "Replaced with the new one" requires relocatable strings.
Not necessarily, not in the example I've shown:
(setq str (do-something-with str))
> But suppose we made a function like aset which returned
> the string. That way, it could return a new string when necessary.
> It would be used like
>
> (setq s (sset s idx newchar))
>
> 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.
- Re: `aset` on strings, changing the size in bytes, (continued)
- Re: `aset` on strings, changing the size in bytes, Paul Eggert, 2018/09/07
- Re: `aset` on strings, changing the size in bytes, Eli Zaretskii, 2018/09/08
- Re: `aset` on strings, changing the size in bytes, Stefan Monnier, 2018/09/08
- Re: `aset` on strings, changing the size in bytes, Eli Zaretskii, 2018/09/08
- Re: `aset` on strings, changing the size in bytes, Stefan Monnier, 2018/09/08
- Re: `aset` on strings, changing the size in bytes, Eli Zaretskii, 2018/09/08
- Re: `aset` on strings, changing the size in bytes, Stefan Monnier, 2018/09/08
- Re: `aset` on strings, changing the size in bytes, Eli Zaretskii, 2018/09/09
- Re: `aset` on strings, changing the size in bytes, Stefan Monnier, 2018/09/09
- Re: `aset` on strings, changing the size in bytes, Richard Stallman, 2018/09/09
- Re: `aset` on strings, changing the size in bytes,
Eli Zaretskii <=
- Re: `aset` on strings, changing the size in bytes, Noam Postavsky, 2018/09/09
- Re: `aset` on strings, changing the size in bytes, Eli Zaretskii, 2018/09/09
- Re: `aset` on strings, changing the size in bytes, Noam Postavsky, 2018/09/09
- Re: `aset` on strings, changing the size in bytes, Richard Stallman, 2018/09/10
- Re: `aset` on strings, changing the size in bytes, Stefan Monnier, 2018/09/09
- Re: `aset` on strings, changing the size in bytes, Richard Stallman, 2018/09/10
- Re: `aset` on strings, changing the size in bytes, Richard Stallman, 2018/09/10
- Re: `aset` on strings, changing the size in bytes, Stefan Monnier, 2018/09/09
Re: `aset` on strings, changing the size in bytes, Helmut Eller, 2018/09/08