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:01:12 -0500 (CDT)

>From my previous message:

     @defun ring-elements ring
     This returns a list of the objects in @var{ring}, in no particular
   ! order.  The length of that list is always the ring size.  If the ring
   ! length is less than the ring size, the entries of the list that do not
   ! correspond to ring elements are @code{nil}.
     @end defun

Maybe I am trying to document a bug here.  Maybe it is better not to
add these two sentences and instead make `ring-elements' do what the
first sentence above, and its docstring, say it does.  `ring-elements'
is not used in the Emacs sources, so the change is not going to break
anything and all it does is make the function work as documented.

I can install if desired.

===File ~/ring.el-diff======================================
*** ring.el     02 Sep 2003 07:41:57 -0500      1.18
--- ring.el     18 Jun 2005 18:45:44 -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,164 ----
        (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)
!     (setq 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]