From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Roland Winkler Newsgroups: gmane.emacs.help Subject: Re: replacing a certain element in a list with another Date: 24 Oct 2003 00:03:24 +0200 Organization: FAU Erlangen-Nuernberg Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: <9PBlb.171$lK3.18@news.level3.com> <8jSlb.186$lK3.106@news.level3.com> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1066947371 26624 80.91.224.253 (23 Oct 2003 22:16:11 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 23 Oct 2003 22:16:11 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Oct 24 00:16:09 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 1ACnkX-00077D-01 for ; Fri, 24 Oct 2003 00:16:09 +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 1ACnkX-0002Fe-5F for geh-help-gnu-emacs@m.gmane.org; Thu, 23 Oct 2003 18:16:09 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!headwall.stanford.edu!newshub.sdsu.edu!small1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeed.stueberl.de!news-mue1.dfn.de!news-nue1.dfn.de!uni-erlangen.de!news.uni-erlangen.de!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 37 Original-NNTP-Posting-Host: tfkp07.physik.uni-erlangen.de Original-X-Trace: rznews2.rrze.uni-erlangen.de 1066946604 29306 131.188.164.207 (23 Oct 2003 22:03:24 GMT) Original-X-Complaints-To: news@uni-erlangen.de Original-NNTP-Posting-Date: 23 Oct 2003 22:03:24 GMT User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Original-Xref: shelby.stanford.edu gnu.emacs.help:117570 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:13502 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:13502 Barry Margolin writes: > In article , > 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. > > Why? Then if someone came up with a way to do the reversing efficiently in > a different way, they wouldn't be able to change it, because the > documentation would lock them into the current behavior. > > The documentation should only specify the parts of the behavior that users > can depend on, not incidental results of a particular implementation. The info page for nreverse gives an example for the results obtained by the present implementation of nreverse where the argument is converted into a 1-element list containing the last element of the reversed list. I find this example rather confusing because it is given wihtout further explanation which rules nreverse is obeying when it modifies its argument destructively. However, if I understand you correctly it does not even make sense to ask which rules nreverse is using here because they depend on the implementation of nreverse. It is nothing one could rely upon. If indeed we are talking here about something that is implementation-dependent, it would be better to replace this example with a sentence saying that nreverse "destroys" its argument in an implementation-dependent way such that only the return value is a well-defined object. Then I would know that it doesn't make sense to ask the question whether the argument of nreverse may be used for anything else after it was passed to nreverse. Or am I missing something here? Roland