From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Luc Teirlinck Newsgroups: gmane.emacs.devel Subject: Re: number-sequence Date: Fri, 21 Nov 2003 08:43:02 -0600 (CST) Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <200311211443.hALEh2415564@raven.dms.auburn.edu> References: <200311200339.hAK3dGE07492@raven.dms.auburn.edu> <87smkji35l.fsf@mail.jurta.org> <200311210437.hAL4bIU14845@raven.dms.auburn.edu> NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1069428635 14497 80.91.224.253 (21 Nov 2003 15:30:35 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 21 Nov 2003 15:30:35 +0000 (UTC) Cc: juri@jurta.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Fri Nov 21 16:30:32 2003 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1ANDEu-0000XI-00 for ; Fri, 21 Nov 2003 16:30:32 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1ANDEt-0004T1-00 for ; Fri, 21 Nov 2003 16:30:32 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1ANDjF-0000IW-3K for emacs-devel@quimby.gnus.org; Fri, 21 Nov 2003 11:01:53 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1ANDZ5-0005OL-H3 for emacs-devel@gnu.org; Fri, 21 Nov 2003 10:51:23 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1ANDYD-00057n-Kd for emacs-devel@gnu.org; Fri, 21 Nov 2003 10:51:00 -0500 Original-Received: from [131.204.53.104] (helo=manatee.dms.auburn.edu) by monty-python.gnu.org with esmtp (Exim 4.24) id 1ANDYC-00057K-Th for emacs-devel@gnu.org; Fri, 21 Nov 2003 10:50:29 -0500 Original-Received: from raven.dms.auburn.edu (raven.dms.auburn.edu [131.204.53.29]) by manatee.dms.auburn.edu (8.12.10/8.12.10) with ESMTP id hALEmvKk011208; Fri, 21 Nov 2003 08:48:58 -0600 (CST) Original-Received: (from teirllm@localhost) by raven.dms.auburn.edu (8.11.6+Sun/8.11.6) id hALEh2415564; Fri, 21 Nov 2003 08:43:02 -0600 (CST) X-Authentication-Warning: raven.dms.auburn.edu: teirllm set sender to teirllm@dms.auburn.edu using -f Original-To: storm@cua.dk In-reply-to: (storm@cua.dk) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:18017 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:18017 Kim Storm wrote: > TO is only included if there is an N for which TO = FROM + N * INC. > If INC is nil, it defaults to 1 (one) if TO is larger than FROM, > or to -1 if TO is less than FROM. > If TO is nil or numerically equal to FROM, return (FROM). > If INC is positive and TO is less than FROM, or INC is negative > and TO is larger than FROM, return nil. > If INC is zero and TO is neither nil nor numerically equal to > FROM, signal an error. Is it really necessary to document all those cases ?? All but the first and the last two sentences specify defaults, and hence are, I believe necessary. I believe you suggested the first. In case of the second to last, there might be some possibility of expecting (FROM). Certainly, if you are going to mention that TO is not necessarily inclusive, it makes sense to point out the one case where FROM is not inclusive. The last line tells exactly when an error is going to occur, which is not obvious in all cases, like (number-sequence 5 nil 0) or (number-sequence 5 5 0). They do return (5), but could equally well have thrown an error. You could also suggest to use something like (number-sequence 0.4 0.61 0.2) I believe that, in real programs, the arguments might not be constant integers. I will add: "Alternatively, you can, of course, also replace TO by a slightly larger value." to the end of the doc string. Sincerely, Luc.