User Tools


Accessor SVREF

Syntax

  • svref simple-vector indexelement
  • (setf (svref simple-vector index) new-element)

Arguments and Values

Description

Accesses the element of simple-vector specified by index.

Examples

(defparameter *v* (vector 1 2 'sirens))

*V*

(simple-vector-p *v*)

true

(svref *v* 0)

1

(svref *v* 2)

SIRENS

(setf (svref *v* 1) 'newcomer)

NEWCOMER

*v*

#(1 NEWCOMER SIRENS)

Side Effects

None.

Affected By

None.

Exceptional Situations

None.

See Also

Function AREF, Function SBIT, Function SCHAR, Function VECTOR, {\secref\ConstantModification}

Notes

svref is identical to aref except that it requires its first argument to be a simple vector.

(svref v i) ≡ (aref (the simple-vector v) i)

\issue{CONSTANT-MODIFICATION:DISALLOW}