emacs-devel
[Top][All Lists]
Advanced

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

RE: howto: rotate a ring


From: Drew Adams
Subject: RE: howto: rotate a ring
Date: Fri, 29 Feb 2008 23:37:48 -0800

> > The documentation for ring.el implies that there must be a
> > ring-rotate function -- but there doesn't appear to be an
> > explicit ring-rotate function?
> 
> Indeed.  I don't see anything either -- I think the documentation is
> just wrong.  Maybe it's referring to the wraparound property of rings
> (that if you pass too high an index, the appropriate modulo will be
> performed, that sort of thing).
> 
> Do you need `ring-rotate', or can we just remove that bit from the
> documentation?

If by "rotate" is meant traverse the ring in either direction, then there
are functions to do that, `ring-next' and `ring-previous'. However, I see
that the doc lists both rotation and traversal operations. To me, they are
the same thing, since a ring is circular (turn the ring = advance along it).

I sent a ring.el patch on 2007-10-08 with those functions. Richard installed
it on 2007-10-14:

Revision 1.26 - (view) (download) (annotate) - [select for diffs] 
Sun Oct 14 22:52:59 2007 UTC (4 months, 2 weeks ago) by rms 
Branch: MAIN 
Changes since 1.25: +72 -0 lines 
Diff to previous 1.25 
(ring-convert-sequence-to-ring)
(ring-insert+extend, ring-remove+insert+extend, ring-member)
(ring-next, ring-previous): New functions.






reply via email to

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