From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Barry Margolin Newsgroups: gmane.emacs.help Subject: Re: replacing a certain element in a list with another Date: Fri, 24 Oct 2003 15:06:48 GMT Organization: Level(3) Communications, Woburn, MA Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1067008588 6897 80.91.224.253 (24 Oct 2003 15:16:28 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 24 Oct 2003 15:16:28 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Oct 24 17:16:26 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 1AD3ft-0002jO-00 for ; Fri, 24 Oct 2003 17:16:25 +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 1AD3fE-0002XB-8l for geh-help-gnu-emacs@m.gmane.org; Fri, 24 Oct 2003 11:15:44 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!headwall.stanford.edu!newshub.sdsu.edu!elnk-nf2-pas!elnk-pas-nf1!newsfeed.earthlink.net!newsfeed2.easynews.com!newsfeed1.easynews.com!easynews.com!easynews!crtntx1-snh1.gtei.net!news.gtei.net!news.level3.com.POSTED!53ab2750!not-for-mail Original-Newsgroups: gnu.emacs.help Mail-Copies-To: never X-Newsreader: trn 4.0-test72 (19 April 1999) Originator: barmar@genuity.net (Barry Margolin) Original-Lines: 46 Original-NNTP-Posting-Host: 171.78.176.30 Original-X-Trace: news.level3.com 1067008008 171.78.176.30 (Fri, 24 Oct 2003 15:06:48 GMT) Original-NNTP-Posting-Date: Fri, 24 Oct 2003 15:06:48 GMT Original-Xref: shelby.stanford.edu gnu.emacs.help:117583 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 Precedence: list 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:13515 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:13515 In article , Roland Winkler wrote: >The info node Rearrangement in the elisp manual says: > > - Function: nreverse list > This function reverses the order of the elements of LIST. Unlike > `reverse', `nreverse' alters its argument by reversing the CDRs in > the cons cells forming the list. The cons cell that used to be > the last one in LIST becomes the first cons cell of the value. > > For example: > > (setq x '(a b c)) > => (a b c) > x > => (a b c) > (nreverse x) > => (c b a) > ;; The cons cell that was first is now last. > x > => (a) > >The last two lines I find confusing because they use the argument of >nreverse after it was passed to nreverse. (They gave rise to my Just to illustrate the danger of continuing to use it without re-assigning it. Typically you would write: (setq x (nreverse x)) if you intended to keep using that variable. >question whether the argument of nreverse could be used for anything >"useful" after it was passed to nreverse.) Instead, the info node >could use the same sentence that is used in the docstring of nreverse: > > Returns the beginning of the reversed list. What a function returns is called its "value". So isn't this what is described in the last sentence of the description? -- Barry Margolin, barry.margolin@level3.com Level(3), Woburn, MA *** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups. Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.