All Manuals > LispWorks® User Guide and Reference Manual > 37 The HCL Package

ring-push Function

Summary

Adds a Lisp object to a ring.

Package

hcl

Signature

ring-push object ring => object

Arguments
object
A Lisp object.
ring
A ring object created by make-ring.
Values
object
A Lisp object.
Description

The function ring-push adds object as an element of ring before the "insertion position", which means that a following call to ring-pop will return it. If ring is full, that is the number of elements in ring is the same as its size (see make-ring), then ring-push first removes the element after the insertion point.

Once it finished modifying ring, if ring-push removed an element and there is a delete-function (see make-ring), then ring-push calls delete-function with the element that it removed.

ring-push returns object.

See also

ring-pop
make-ring
rotate-ring
ring-ref


LispWorks® User Guide and Reference Manual - 01 Dec 2021 19:30:35