emacs-devel
[Top][All Lists]
Advanced

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

Re: Would seq-range and seq-mapcat be useful?


From: Nicolas Petton
Subject: Re: Would seq-range and seq-mapcat be useful?
Date: Thu, 29 Jan 2015 23:06:50 +0100
User-agent: mu4e 0.9.9.6pre3; emacs 24.4.1

Stefan Monnier <address@hidden> writes:

> I have no idea what those names are supposed to evoke.  Can you tell us
> what they'd do?

Sure, `seq-range' would be a convenient way to create a sequence of
numbers. A simple implementation could be:

(defun seq-range (start end)
  (let ((lst nil))
    (while (< start end)
      (push end lst)
      (setq end (1- end)))
    lst))

`seq-mapcat' would apply `seq-concatenate' to the result of `seq-map':

(defun seq-mapcat (function seq &optional type)
  (apply #'seq-concatenate (or type 'list)
         (seq-map function seq)))

Cheers,
Nico
-- 
Nicolas Petton
http://nicolas-petton.fr




reply via email to

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