;;; compiled by eric@mole.gnu.ai.mit.edu on Sun Apr 25 18:31:05 1993
;;; from file /gd/gnu/emacs/19.0/lisp/ring.el
;;; emacs version 19.5.3.
;;; bytecomp version FSF 2.08
;;; optimization is on.

(defalias 'ring-p #[(x) ":… Á@!… A:… ÁA@!… ÂAA!‡" [x integerp vectorp] 2 "\
Returns t if X is a ring; nil otherwise."])
(defalias 'make-ring #[(size) "À‰Á\nÃ\"BB‡" [0 make-vector size nil] 5 "\
Make a ring that can contain SIZE elements."])
(defalias 'ring-plus1 #[(index veclen) "Á\\‰Uƒ Ä‚ \n)‡" [index 1 new-index veclen 0] 3 "\
INDEX+1, with wraparound"])
(defalias 'ring-minus1 #[(index veclen) "ÁUƒ\n \n‚ ÃZ‡" [index 0 veclen 1] 2 "\
INDEX-1, with wraparound"])
(defalias 'ring-length #[(ring) "A@‡" [ring] 1 "\
Number of elements in the ring."])
(byte-code "ÀÁMˆÂÃM‡" [ring-empty-p #[(ring) "A@ÁU‡" [ring 0] 2] ring-index #[(index head ringlen veclen) "À	\n\"À\n	Z\\S\"‡" [ring-mod index ringlen head veclen] 4]] 2)
(defalias 'ring-insert #[(ring item) "AA‰G@A@	Å\\\n\"I\nUƒ) ÇÈ\n\"\"ˆ‚0 ÇAT\"ˆ,‡" [ring vec veclen hd ln ring-mod item setcar ring-plus1] 7 "\
Insert a new item onto the ring. If the ring is full, dump the oldest
item to make room."])
(defalias 'ring-remove #[(ring &optional index) "À	!ƒ\n ÂÃ!‡	@	A@	AA‰GÈ\\S\"	Ê„0 SÍ$H	U„d Î\"HIˆÎ\"‰‚C 	ÊIˆÏ	AS\"ˆ.‡" [ring-empty-p ring error "Ring empty" hd ln vec veclen ring-mod tl nil oldelt index ring-index ring-plus1 setcar] 7 "\
Remove an item from the RING.  Return the removed item.
If optional INDEX is nil, remove the oldest item.  If it's
numeric, remove the element indexed."])
(defalias 'ring-mod #[(n m) "À	\n\"‰ÃYƒ 	‚ 	\nÃYƒ \n‚ \n[\\)‡" [% n m 0] 4 "\
Returns N mod M.  M is positive.
Answer is guaranteed to be non-negative, and less than m."])
(defalias 'ring-ref #[(ring index) "À	!ƒ\n ÂÃ!‡	@	A@	AA‰ÇG$H+‡" [ring-empty-p ring error "indexed empty ring" hd ln vec ring-index index] 7 "\
Returns RING's INDEX element.
INDEX need not be <= the ring length, the appropriate modulo operation
will be performed.  Element 0 is the most recently inserted; higher indices
correspond to older elements until they wrap."])
(provide (quote ring))
