unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: David Kastrup <dak@gnu.org>
To: emacs-devel@gnu.org
Subject: Re: (n)reverse vs. length
Date: Wed, 14 May 2014 22:12:16 +0200	[thread overview]
Message-ID: <87r43wrufz.fsf@fencepost.gnu.org> (raw)
In-Reply-To: jwvha4stc2u.fsf-monnier+emacs@gnu.org

Stefan Monnier <monnier@IRO.UMontreal.CA> writes:

>> Should (n)reverse has the same semantics as length, i.e. accept
>> vectors and strings as well?
>
> Good question.
>
>> IMHO this is the convenient and expected behavior from the point of
>> view of the elisp programmer.
>
> Elisp is pretty lame and messy in this respect.
> E.g. we have elt/aref/nth which operate on various subsets of sequences.
> We have mapc/mapcar which apply to lists and arrays (and strings), but
> mapcar returns a list in any case.
>
> I think it would be OK to make `reverse' work on arrays and strings.
> I definitely don't want `nreverse' working on strings (strings should
> be immutable),

Doesn't aset work on strings?

-- 
David Kastrup




  reply	other threads:[~2014-05-14 20:12 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 [this message]
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

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=87r43wrufz.fsf@fencepost.gnu.org \
    --to=dak@gnu.org \
    --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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).