[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: request for a new function, say, `sequence'

From: Satyaki Das
Subject: Re: request for a new function, say, `sequence'
Date: Mon, 24 Mar 2003 21:05:08 -0800

Kenichi Handa <address@hidden> writes:

> In article <address@hidden>, "Satyaki Das" <address@hidden> 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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]