From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: (n)reverse vs. length Date: Wed, 14 May 2014 15:10:47 -0400 Message-ID: References: <53737B79.7020704@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1400094679 3330 80.91.229.3 (14 May 2014 19:11:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 14 May 2014 19:11:19 +0000 (UTC) Cc: Emacs development discussions To: Dmitry Antipov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed May 14 21:11:12 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Wkea5-0000MT-0I for ged-emacs-devel@m.gmane.org; Wed, 14 May 2014 21:11:09 +0200 Original-Received: from localhost ([::1]:53864 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wkea4-0001yw-ET for ged-emacs-devel@m.gmane.org; Wed, 14 May 2014 15:11:08 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58582) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WkeZv-0001x8-4Y for emacs-devel@gnu.org; Wed, 14 May 2014 15:11:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WkeZn-0002sl-LD for emacs-devel@gnu.org; Wed, 14 May 2014 15:10:59 -0400 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:41070) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WkeZn-0002sh-HB for emacs-devel@gnu.org; Wed, 14 May 2014 15:10:51 -0400 Original-Received: from pastel.home (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id s4EJAmwm009524; Wed, 14 May 2014 15:10:49 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id D5364601E4; Wed, 14 May 2014 15:10:47 -0400 (EDT) In-Reply-To: <53737B79.7020704@yandex.ru> (Dmitry Antipov's message of "Wed, 14 May 2014 18:19:37 +0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV4942=0 X-NAI-Spam-Version: 2.3.0.9378 : core <4942> : inlines <869> : streams <1182820> : uri <1756781> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 132.204.246.22 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:171840 Archived-At: > 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), but I guess making it work on arrays is fine. Stefan