[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: Tue, 25 Mar 2003 12:10:17 -0800

Kenichi Handa <address@hidden> writes:

> In article <address@hidden>, "Satyaki Das" <address@hidden> writes:
> >>  (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)))
> > (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)))
> It's not the point.  How to use a list returned by `range'
> (or `sequence') and how to make such a list is a different
> thing.

I am trying to show that by using existing macros and functions we
can express the algorithms as clearly and succintly as with the
new `range'. Do you have a counter-example to this?

> Of course, we can implement the functionality of `range' by
> using loop, while, dotimes, etc.  But, it doesn't mean that
> we don't need a simpler/convenient function `range'.

IMO, a new builtin function is needed if and only if it makes
writing code easier or makes it simpler.

I think calling the new function `sequence' or `range' is a
mistake. Lisp already has the functions `string' and `vector'
which are data type constructors. Either of the suggested names
sound like a new data type (in fact there is already a data type
called sequence and a predicate sequencep) and so inconsistent
with the current naming conventions.

So I suggest that a more descriptive name be chosen -- for
instance something like `make-sequence-of-numbers'.


reply via email to

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