Removes an element from a ring and returns the element before the insertion point.
ring-pop ring &optional remove => object
A ring object created by make-ring.
A generalized boolean.
A Lisp object.
ring-pop removes (by default) an element from the ring and returns the element before the insertion point.
If remove is true then the element is removed from the ring. If remove is
nil then the element remains and instead the ring is rotated by 1 as if by
(rotate-ring ring 1). The default value of remove is
ring-pop signals an error when called on an empty ring.
These 3 forms all return the same values, but the first form removes an element from the ring, while the other two leave all the elements in the ring:
(values (ring-pop ring) (ring-ref ring 0))
(values (ring-pop ring t) (ring-ref ring 0))
(values (ring-ref ring 0) (rotate-ring ring 1))
LispWorks User Guide and Reference Manual - 20 Sep 2017