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: Vinicius Jose Latorre
Subject: Re: request for a new function, say, `sequence'
Date: Thu, 03 Apr 2003 23:11:50 -0300
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3) Gecko/20030312

Here is another implementation of number-sequence.
It takes in consideration that the number can be an integer or float.
Also have an INC argument.

(defun number-sequence (from &optional to inc)
 (if (not to)
     (list from)
   (or inc (setq inc 1))
   (let (seq)
     (while (<= from to)
       (setq seq (cons from seq)
             from (+ from inc)))
     (nreverse seq))))






reply via email to

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