From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Satyaki Das" Newsgroups: gmane.emacs.devel Subject: Re: request for a new function, say, `sequence' Date: Mon, 24 Mar 2003 21:05:08 -0800 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <4946.1048568708@theforce.Stanford.EDU> 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> NNTP-Posting-Host: main.gmane.org X-Trace: main.gmane.org 1048568855 493 80.91.224.249 (25 Mar 2003 05:07:35 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 25 Mar 2003 05:07:35 +0000 (UTC) Cc: monnier+gnu/emacs@rum.cs.yale.edu Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Tue Mar 25 06:07:33 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 18xger-00007n-00 for ; Tue, 25 Mar 2003 06:07:33 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 18xgff-0000Vc-00 for ; Tue, 25 Mar 2003 06:08:23 +0100 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 18xgdy-00015Z-03 for emacs-devel@quimby.gnus.org; Tue, 25 Mar 2003 00:06:38 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18xgdg-0000wt-00 for emacs-devel@gnu.org; Tue, 25 Mar 2003 00:06:20 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18xgd0-00087e-00 for emacs-devel@gnu.org; Tue, 25 Mar 2003 00:05:42 -0500 Original-Received: from chicory.stanford.edu ([171.64.73.212]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18xgck-00079R-00 for emacs-devel@gnu.org; Tue, 25 Mar 2003 00:05:22 -0500 Original-Received: from dwarka.stanford.edu (ev-01-st2435.Stanford.EDU [128.12.141.17]) by chicory.Stanford.EDU (8.11.6/8.11.6) with ESMTP id h2P55Ix17862; Mon, 24 Mar 2003 21:05:19 -0800 Original-Received: from troodon.stanford.edu (ev-01-st2435.Stanford.EDU [128.12.141.17]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by dwarka.stanford.edu (Postfix) with ESMTP id A7C5E9D14; Mon, 24 Mar 2003 21:05:23 -0800 (PST) Original-Received: from [127.0.0.1] (helo=theforce.Stanford.EDU) by troodon.stanford.edu with esmtp (Exim 4.12) id 18xgcW-0001Hn-00; Mon, 24 Mar 2003 21:05:08 -0800 Original-To: Kenichi Handa In-Reply-To: <200303250446.NAA06974@etlken.m17n.org> X-Mailer: MH-E 7.2+cvs; nmh 1.1; GNU Emacs 21.3.50.4 X-Image-URL: http://chicory.stanford.edu/satyaki/satyaki3.jpg Original-cc: emacs-devel@gnu.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:12599 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:12599 Kenichi Handa writes: > In article <1191.1048560083@theforce.Stanford.EDU>, "Satyaki Das" writes: > > The examples in this thread have all created a list (or vector) > > and then iterated over the elements. > > The original version of `sequence' is `devanagari-range', > and it it used as below. > > (defun dev-charseq (from &optional to) > (if (null to) (setq to from)) > (mapcar (function (lambda (x) (indian-glyph-char x 'devanagari))) > (devanagari-range from to))) I would have written it as follows: (defun dev-charseq (lower &optional upper) (if (null upper) (setq upper lower)) (loop for x from lower to upper collect (indian-glyph-char x 'devanagiri))) I changed "from" to "lower" and "to" to "upper" since the loop looks sort of funny otherwise. > > If the preloaded file is compiled then 'cl isn't actually loaded > > at run time. > > Yes, I know that. So, I understood that not requiring cl is > a kind of coding convention. If there's no such convention > now, that ok, but still loop doesn't work for iterating over > dev-glyph-cvn in the above example. I did a grep through the sources and there are 118 files that already contain the line, (eval-when-compile (require 'cl)) So I hope adding another of these won't be a problem. Satyaki