Luc Teirlinck <[EMAIL PROTECTED]> writes:

> (defun ring-elements (ring)
>   "Return a list of the elements of RING in order, newest first."
>   (let (lst)
>     (dotimes (var (ring-length ring))
>       (push (ring-ref ring var) lst))
>     (nreverse lst)))

an index of -1 returns the "oldest" element.
so you could just `(ring-ref ring -1)' until the
ring is exhausted, obviating both `nreverse' and
`var' reference, while keeping the abstraction.

thi


_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

Reply via email to