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

NextPrevUpTopContentsIndex

ring-ref

Function
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) object ring index

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 function ring-ref returns or sets the element at index places before the insertion point in the ring 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 - 13 Feb 2015

NextPrevUpTopContentsIndex