all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* howto: rotate a ring
@ 2008-03-01  3:01 T. V. Raman
  2008-03-01  4:23 ` Karl Fogel
  0 siblings, 1 reply; 3+ messages in thread
From: T. V. Raman @ 2008-03-01  3:01 UTC (permalink / raw)
  To: emacs-devel

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?

-- 
Best Regards,
--raman

      
Email:  raman@users.sf.net
WWW:    http://emacspeak.sf.net/raman/
AIM:    emacspeak       GTalk: tv.raman.tv@gmail.com
PGP:    http://emacspeak.sf.net/raman/raman-almaden.asc
Google: tv+raman 
IRC:    irc://irc.freenode.net/#emacs




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: howto: rotate a ring
  2008-03-01  3:01 howto: rotate a ring T. V. Raman
@ 2008-03-01  4:23 ` Karl Fogel
  2008-03-01  7:37   ` Drew Adams
  0 siblings, 1 reply; 3+ messages in thread
From: Karl Fogel @ 2008-03-01  4:23 UTC (permalink / raw)
  To: raman; +Cc: emacs-devel

"T. V. Raman" <raman@users.sf.net> writes:
> 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?

-Karl




^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: howto: rotate a ring
  2008-03-01  4:23 ` Karl Fogel
@ 2008-03-01  7:37   ` Drew Adams
  0 siblings, 0 replies; 3+ messages in thread
From: Drew Adams @ 2008-03-01  7:37 UTC (permalink / raw)
  To: 'Karl Fogel', raman; +Cc: rms, emacs-devel

> > 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.






^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-03-01  7:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-01  3:01 howto: rotate a ring T. V. Raman
2008-03-01  4:23 ` Karl Fogel
2008-03-01  7:37   ` Drew Adams

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.