emacs-pretest-bug
[Top][All Lists]
Advanced

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

Re: Maybe bug with multibyte string and aset


From: Stefan Monnier
Subject: Re: Maybe bug with multibyte string and aset
Date: Wed, 11 Oct 2006 22:07:26 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

>   (aset foo 0 ?\!!)

As a general rule I recommend to never use `aset' on strings.  It turns out
that it's indeed rarely used, and that implementing it is stupidly tricky
and potentially much more costly than one would think.
My own local Emacs is hacked to disallow `aset' on strings and it works
just fine.  A few packages need minor changes: either replace the string by
a vector, or replace a bunch of `aset' by a `concat'.   The end result is
generally at least as readable, sometimes more.
If there was a `mapstring' (i.e. a generalization of subst-char-in-string)
function it would be even harder to justify the use of `aset' on strings.


        Stefan




reply via email to

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