all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@IRO.UMontreal.CA>
To: Dmitry Antipov <dmantipov@yandex.ru>
Cc: David Kastrup <dak@gnu.org>, emacs-devel@gnu.org
Subject: Re: (n)reverse vs. length
Date: Thu, 15 May 2014 08:38:32 -0400	[thread overview]
Message-ID: <jwv8uq3p6cb.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <5374429A.3090704@yandex.ru> (Dmitry Antipov's message of "Thu, 15 May 2014 08:29:14 +0400")

> 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



      parent reply	other threads:[~2014-05-15 12:38 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-14 14:19 (n)reverse vs. length Dmitry Antipov
2014-05-14 19:10 ` Stefan Monnier
2014-05-14 20:12   ` David Kastrup
2014-05-15  1:45     ` Stefan Monnier
2014-05-15  4:29       ` Dmitry Antipov
2014-05-15  5:49         ` David Kastrup
2014-05-15 12:38         ` Stefan Monnier [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwv8uq3p6cb.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=dak@gnu.org \
    --cc=dmantipov@yandex.ru \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.