From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.help Subject: Re: replacing a certain element in a list with another Date: Thu, 23 Oct 2003 09:30:42 -0600 Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: 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 1066923992 14619 80.91.224.253 (23 Oct 2003 15:46:32 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 23 Oct 2003 15:46:32 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Oct 23 17:46:28 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 1AChfQ-0004tF-00 for ; Thu, 23 Oct 2003 17:46:28 +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 1AChfM-0005N8-6N for geh-help-gnu-emacs@m.gmane.org; Thu, 23 Oct 2003 11:46:24 -0400 Original-Path: shelby.stanford.edu!170.207.51.80!not-for-mail Original-Newsgroups: gnu.emacs.help,gnu.emacs.bug Original-Lines: 32 Original-NNTP-Posting-Host: monty-python.gnu.org Original-X-Trace: news.Stanford.EDU 1066923107 1858 199.232.76.173 (23 Oct 2003 15:31:47 GMT) Original-X-Complaints-To: news@news.stanford.edu 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 Original-Xref: shelby.stanford.edu gnu.emacs.help:117556 gnu.emacs.bug:33660 X-Originally-To: gnu-emacs-bug@moderators.isc.org Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:13488 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:13488 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