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

ring-ref Accessor

Summary

Gets or sets the element at a specified offset from the insertion point in a ring.

Package

hcl

Signature

ring-ref ring index => object

setf (ring-ref ring index) object => object

Arguments
ring
A ring object created by make-ring.
index
A non-negative integer.
object
A Lisp object.
Values
object
A Lisp object.
Description

The accessor ring-ref returns or sets the element at index places before the insertion point in ring.

index must be a non-negative integer smaller than the number of elements in the ring, otherwise an error is signaled. index 0 returns or sets the element object just before the insertion point, and a larger index goes "back" (in the same direction as ring-pop and rotate-ring).

The setf function replaces the element in the ring with the new element object without affecting the ring otherwise (in particular it does not call delete-function).

See also

make-ring
ring-pop
rotate-ring


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