emacs-devel
[Top][All Lists]
Advanced

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

Re: lists.texi


From: Luc Teirlinck
Subject: Re: lists.texi
Date: Sat, 18 Jun 2005 19:15:26 -0500 (CDT)

The following patch to ring.el is equivalent to the one I sent
earlier, but probably slightly better:

===File ~/ring.el-diff-b====================================
*** ring.el     02 Sep 2003 07:41:57 -0500      1.18
--- ring.el     18 Jun 2005 18:53:24 -0500      
***************
*** 155,162 ****
        (aref vec (ring-index index hd ln (length vec))))))
  
  (defun ring-elements (ring)
!   "Return a list of the elements of RING."
!   (mapcar #'identity (cddr ring)))
  
  ;;; provide ourself:
  
--- 155,163 ----
        (aref vec (ring-index index hd ln (length vec))))))
  
  (defun ring-elements (ring)
!   "Return a list of the elements of RING, in no particular order."
!   (let ((lst (delq nil (mapcar #'identity (cddr ring)))))
!     (nconc lst (make-list (- (ring-length ring) (length lst)) nil))))
  
  ;;; provide ourself:
  
============================================================




reply via email to

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