From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Miles Bader Newsgroups: gmane.emacs.devel Subject: Re: request for a new function, say, `sequence' Date: 03 Apr 2003 12:44:46 +0900 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: References: <200303230302.MAA04327@etlken.m17n.org> <200303241541.h2OFfbpa011227@rum.cs.yale.edu> <200303250015.JAA06592@etlken.m17n.org> <200303250050.JAA06631@etlken.m17n.org> <200303250057.h2P0vBj6016367@rum.cs.yale.edu> <200303250125.KAA06703@etlken.m17n.org> <32627.1048557446@theforce.Stanford.EDU> <200303250208.LAA06802@etlken.m17n.org> <1191.1048560083@theforce.Stanford.EDU> <200303250446.NAA06974@etlken.m17n.org> <4946.1048568708@theforce.Stanford.EDU> <200303261218.VAA09242@etlken.m17n.org> <200304030254.LAA06098@etlken.m17n.org> Reply-To: Miles Bader NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1049342384 1700 80.91.224.249 (3 Apr 2003 03:59:44 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Thu, 3 Apr 2003 03:59:44 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Thu Apr 03 05:59:43 2003 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 190vt9-0000RH-00 for ; Thu, 03 Apr 2003 05:59:43 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 190vuW-0007Ep-00 for ; Thu, 03 Apr 2003 06:01:09 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 190vrb-0006aa-02 for emacs-devel@quimby.gnus.org; Wed, 02 Apr 2003 22:58:07 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 190vqz-0006Rd-00 for emacs-devel@gnu.org; Wed, 02 Apr 2003 22:57:29 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 190vq7-000567-00 for emacs-devel@gnu.org; Wed, 02 Apr 2003 22:56:35 -0500 Original-Received: from tyo201.gate.nec.co.jp ([210.143.35.51]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 190vnF-00041R-00; Wed, 02 Apr 2003 22:53:37 -0500 Original-Received: from mailgate3.nec.co.jp ([10.7.69.194])h333itw07483; Thu, 3 Apr 2003 12:44:55 +0900 (JST) Original-Received: (from root@localhost) by mailgate3.nec.co.jp (8.11.6/3.7W-MAILGATE-NEC) id h333isL08896; Thu, 3 Apr 2003 12:44:54 +0900 (JST) Original-Received: from edsgm02.lsi.nec.co.jp ([10.50.208.12]) by mailsv4.nec.co.jp (8.11.6/3.7W-MAILSV4-NEC) with ESMTP id h333ir522353; Thu, 3 Apr 2003 12:44:53 +0900 (JST) Original-Received: from mcsss2.ucom.lsi.nec.co.jp (localhost [127.0.0.1]) MAA24501; Thu, 3 Apr 2003 12:44:53 +0900 (JST) Original-Received: from mcspd15.ucom.lsi.nec.co.jp (mcspd15 [10.30.114.174]) with ESMTP id h333ikNH004242; Thu, 3 Apr 2003 12:44:51 +0900 (JST) Original-Received: by mcspd15.ucom.lsi.nec.co.jp (Postfix, from userid 31295) id 79A873724; Thu, 3 Apr 2003 12:44:46 +0900 (JST) Original-To: Kenichi Handa System-Type: i686-pc-linux-gnu Blat: Foop In-Reply-To: <200304030254.LAA06098@etlken.m17n.org> Original-Lines: 29 Original-cc: rms@gnu.org Original-cc: ttn@glug.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Emacs development discussions. List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:12858 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:12858 Kenichi Handa writes: > I've just installed it in subr.el. I implemented it as below. The interface looks good. How about the following implementation: (defun number-sequence (from &optional to) "Return a sequence of numbers from FROM to TO (both inclusive) as a list. The Nth element of the list is (+ FROM N) where N counts from zero. If TO is nil, it defaults to FROM. If TO is less than FROM, the value is nil." (unless to (setq to from)) (let ((seq nil)) (while (>= to from) (push to seq) (setq to (1- to))) seq)) > In Emacs, the word "number" includes a floating number. Should we > make number-sequence work also for floating numbers? Well, it will already, as long as TO and FROM differ by an integral amount... -Miles -- "Though they may have different meanings, the cries of 'Yeeeee-haw!' and 'Allahu akbar!' are, in spirit, not actually all that different."