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: Thien-Thi Nguyen
Subject: Re: request for a new function, say, `sequence'
Date: Thu, 03 Apr 2003 05:41:29 -0500

here's another implementation that builds the list from the end.
also, the individual input conditions are handled directly.

thi

________________________________________________
(defun number-sequence (from &optional to)
  (cond ((not to) (list from))
        ((< to from) nil)
        (t (let ((ans (list to)))
             (while (< from to)
               (setq ans (cons (setq to (1- to)) ans)))
             ans))))




reply via email to

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