emacs-devel
[Top][All Lists]
Advanced

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

Re: (n)reverse vs. length


From: Stefan Monnier
Subject: Re: (n)reverse vs. length
Date: Thu, 15 May 2014 08:38:32 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux)

> Hm, what about an existing code which relies on aset'table strings?

I recommend against it.  And I've been known to install changes in trunk
to make such code use arrays instead (or avoid `aset', depending on the
situation).

> Questions like
> http://lists.gnu.org/archive/html/emacs-devel/2014-04/msg00378.html
> shows that treating string as an array of characters is a common
> practice (which is "natural" for the people with C background).

I know.  And we should discourage that practice.

> And, in case of large strings, in-place reverse may save a lot
> of memory.

I can't think of any case where it can save a significant amount
of memory.


        Stefan



reply via email to

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