emacs-devel
[Top][All Lists]
Advanced

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

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


From: Luc Teirlinck
Subject: Re: request for a new function, say, `sequence'
Date: Thu, 27 Mar 2003 11:03:02 -0600 (CST)

Stefan Monnier wrote:

   >    How about
   > 
   >       (dotimes (VAR [START END] RESULT) BODY...)
   > 
   > I do not completely understand this.

   [...] is Elisp notation for vectors.  I see that it is ambiguous
   because [...] is also used in such contexts to denote optional
   arguments.

So, unless START and END are constants, a typical usage would be:

(dotimes (var (vector start end) result) body...)

(if I now understand correctly).

Seems OK, but 

(dotimes (VAR COUNT [RESULT START]) BODY...))

would have the double advantage of keeping the meaning of the second
argument of dotimes (and of the name dotimes) as doing something COUNT
times and of allowing evaluation without an extra call to vector,
list, cons or whatever.  On the other hand, the semantics you proposed
would be more convenient for things like:

(dotimes (var [?a ?z] result) body...)

So if we expect a lot of uses of that type, it would be preferable.

Anyway, the first decision to be made is whether there is a sufficient
need for the functionality.  If yes, we can discuss the semantics.
(And then both of the above, as well as some semantics suggested
earlier seem OK to me.)

Sincerely,

Luc.





reply via email to

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