;ELC   
;;; compiled by cthomp@willow on Wed Aug 25 18:07:42 1993
;;; from file /era/era-working/editor/lisp/utils/ring.el
;;; emacs version 19.8 (beta8) Lucid.
;;; bytecomp version 2.17; 23-aug-93.
;;; optimization is on.
;;; this file uses opcodes which do not exist in Emacs 18.

(if (and (boundp 'emacs-version)
	 (or (and (boundp 'epoch::version) epoch::version)
	     (string-lessp emacs-version "19")))
    (error "This file was compiled for Emacs 19."))

(fset 'ring-p #[(x) ":­•@¨­�A:­‹A@¨­…ÁAA!‡" [x vectorp] 2 "\
Returns t if X is a ring; nil otherwise."])
(fset 'make-ring #[(size) "À‰Á\nÃ\"BB‡" [0 make-vector size nil] 5 "\
Make a ring that can contain SIZE elements."])
(fset 'ring-plus1 #[(index veclen) "Á\\‰U«ƒÄª�\n)‡" [index 1 new-index veclen 0] 3 "\
INDEX+1, with wraparound"])
(fset 'ring-minus1 #[(index veclen) "ÁU«ƒ\nª�ÃZ‡" [index 0 veclen 1] 2 "\
INDEX-1, with wraparound"])
(fset '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\"‡" [mod index ringlen head veclen] 4]] 2)
(fset 'ring-insert #[(ring item) "AA‰G@A@	Å\\\n\"I\nU«‰Ç\n\" ˆª†AT ˆ,‡" [ring vec veclen hd ln mod item ring-plus1] 6 "\
Insert a new item onto the ring. If the ring is full, dump the oldest
item to make room."])
(fset 'ring-remove #[(ring &optional index) "À	!«„ÂÃ!‡	@	A@	AA‰GÈ\\S\"	Ê¬„SÍ$H	U¬šÎ\"HIˆÎ\"‰ªa	ÊIˆ	AS ˆ.‡" [ring-empty-p ring error "Ring empty" hd ln vec veclen mod tl nil oldelt index ring-index ring-plus1] 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."])
(fset 'ring-ref #[(ring index) "À	!«„ÂÃ!‡	@	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 'ring)
