From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#18253: 24.4.50; doc string of `remq': correct it per the doc of `remove' Date: Wed, 27 Aug 2014 07:06:51 -0700 (PDT) Message-ID: <537440a2-c7e9-4a65-81e4-7cc7e9a18f97@default> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1409148517 9786 80.91.229.3 (27 Aug 2014 14:08:37 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 27 Aug 2014 14:08:37 +0000 (UTC) Cc: 18253@debbugs.gnu.org To: tsugutomo.enami@jp.sony.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Aug 27 16:08:30 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1XMdth-0006gz-7O for geb-bug-gnu-emacs@m.gmane.org; Wed, 27 Aug 2014 16:08:25 +0200 Original-Received: from localhost ([::1]:59759 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMdtg-00035w-OK for geb-bug-gnu-emacs@m.gmane.org; Wed, 27 Aug 2014 10:08:24 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40868) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMdtT-00034T-MD for bug-gnu-emacs@gnu.org; Wed, 27 Aug 2014 10:08:21 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XMdtK-0000YF-VE for bug-gnu-emacs@gnu.org; Wed, 27 Aug 2014 10:08:11 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:46772) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMdtK-0000Y7-SQ for bug-gnu-emacs@gnu.org; Wed, 27 Aug 2014 10:08:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XMdtK-0001ra-22 for bug-gnu-emacs@gnu.org; Wed, 27 Aug 2014 10:08:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 27 Aug 2014 14:08:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18253 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 18253-submit@debbugs.gnu.org id=B18253.14091484237091 (code B ref 18253); Wed, 27 Aug 2014 14:08:01 +0000 Original-Received: (at 18253) by debbugs.gnu.org; 27 Aug 2014 14:07:03 +0000 Original-Received: from localhost ([127.0.0.1]:53715 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XMdsM-0001qI-Qm for submit@debbugs.gnu.org; Wed, 27 Aug 2014 10:07:03 -0400 Original-Received: from userp1040.oracle.com ([156.151.31.81]:36475) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XMdsK-0001pn-Dw for 18253@debbugs.gnu.org; Wed, 27 Aug 2014 10:07:01 -0400 Original-Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id s7RE6r9V003960 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 27 Aug 2014 14:06:54 GMT Original-Received: from aserz7022.oracle.com (aserz7022.oracle.com [141.146.126.231]) by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s7RE6qX9022612 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 27 Aug 2014 14:06:53 GMT Original-Received: from abhmp0004.oracle.com (abhmp0004.oracle.com [141.146.116.10]) by aserz7022.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s7RE6pWb020951; Wed, 27 Aug 2014 14:06:51 GMT In-Reply-To: X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.8.2 (807160) [OL 12.0.6691.5000 (x86)] X-Source-IP: ucsinet21.oracle.com [156.151.31.93] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:92713 Archived-At: > > And most (all other?) Lisps have given it the same behavior as > > `remove', the only difference being to use `eq' instead of `equal'. > > IOW, they systematically copy the sequence. >=20 > How about to avoid the use of word `copy' to describe both `remq' > and `remove'? Because that is precisely what is important. Why "avoid" what it is most important to communicate to users? > The point of remq/remove is non-destructive operation. Whether it > returns a copy or not is not important. This matches CL's `remove' > definition. No, it does not. From CLTL, section 14.3, "Modifying Sequences": The result is a sequence of the same kind as the argument SEQUENCE that has the same elements except that those in the subsequence delimited by :start and :end and satisfying the test (see above) have been removed. This is a non-destructive operation; the result is a copy of the input SEQUENCE, save that some elements are not ^^^^^^^^^ copied. Elements not removed occur in the same order in the result ^^^^^^ that they did in the argument. That text was in the original edition of CTLT (1984), and it has not changed one bit in subsequent revisions. > Actually, even the current `remove' implementation does > not return a copy when SEQ is not a list and there is nothing to > remove. I did not check the C code, but all descriptions of Elisp `delete' for a non-list say that it *always* returns a new object. Perhaps all of those descriptions are incorrect (?), in which case we have a bigger doc problem. > If document explicitly says it returns a copy, reader might think > destructive operation can be performed on the result of both > functions while expecting original sequence unmodified. Which is the case for Common Lisp. And which should be the case for Emacs Lisp for the cases that need to be documented as such (i.e. as copying).