From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.bugs Subject: Re: replacing a certain element in a list with another Date: Thu, 23 Oct 2003 09:30:42 -0600 Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Message-ID: <3F97F422.2030307@yahoo.com> References: <86ekxcykfs.fsf@slowfox.dyndns.org> <9PBlb.171$lK3.18@news.level3.com> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1066923202 12679 80.91.224.253 (23 Oct 2003 15:33:22 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 23 Oct 2003 15:33:22 +0000 (UTC) Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Oct 23 17:33:20 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AChSi-0003q6-00 for ; Thu, 23 Oct 2003 17:33:20 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AChSA-0007l1-6N for geb-bug-gnu-emacs@m.gmane.org; Thu, 23 Oct 2003 11:32:46 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1AChQu-0005uX-V2 for bug-gnu-emacs@prep.ai.mit.edu; Thu, 23 Oct 2003 11:31:28 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1AChQ6-0004q7-HU for bug-gnu-emacs@prep.ai.mit.edu; Thu, 23 Oct 2003 11:31:09 -0400 Original-Received: from [130.59.10.2] (helo=chx400.switch.ch) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.24) id 1AChQ4-0004lv-CI for bug-gnu-emacs@prep.ai.mit.edu; Thu, 23 Oct 2003 11:30:36 -0400 Original-Received: from mail.fu-berlin.de ([160.45.11.165]) by chx400.switch.ch with esmtp (Exim 3.20 #1) id 1AChQ2-0006w9-00 for gnu-emacs-bug@moderators.isc.org; Thu, 23 Oct 2003 17:30:34 +0200 Original-Received: by mail.fu-berlin.de (Smail3.2.0.98) from Curry.ZEDAT.FU-Berlin.DE (160.45.10.36) with esmtp id ; Thu, 23 Oct 2003 17:30:33 +0200 (MEST) Original-Received: by Curry.ZEDAT.FU-Berlin.DE (Smail3.2.0.98) from news.fu-berlin.de with bsmtp id ; Thu, 23 Oct 2003 17:30:33 +0200 (MEST) Original-To: gnu-emacs-bug@moderators.isc.org Original-Path: 170.207.51.80!not-for-mail Original-Newsgroups: gnu.emacs.help,gnu.emacs.bug Original-Lines: 30 X-Orig-NNTP-Posting-Host: 170.207.51.80 X-Orig-X-Trace: news.uni-berlin.de 1066923032 31941658 170.207.51.80 (16 [82742]) User-Agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:0.9.4.1) Gecko/20020406 Netscape6/6.2.2 X-Accept-Language: en-us X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 Precedence: list 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 Xref: main.gmane.org gmane.emacs.bugs:6021 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:6021 Stefan Monnier wrote: >Roland Winkler wrote: >>It might be helpful to add a comment to the docstring or info page >>for nreverse saying that its argument is modified such that >>afterwards it is a 1-element list containing the last element of the >>reversed list. > > I don't think this particular aspect of the behavior should be documented. > Maybe we should add a note saying "the argument should not be used > afterwards", but even that would not be very convincing. > I think the only reasonable thing to put is a "don't use this unless you > know what you're doing". Why not document all the destructive list operations like delq, whose doc string says: If the first member of LIST is ELT, there is no way to remove it by side effect; therefore, write `(setq foo (delq element foo))' to be sure of changing the value of `foo'. For nreverse, it would be: Because the first cons cell of LIST is the last cons cell of the returned list, write `(setq foo (nreverse foo))' to set `foo' to its reversed value. -- Kevin Rodgers