weak-vector

$Revision: 5.0.2.3 $

Function

Package: EXCL

Arguments: (n)

Returns a weak vector of n elements. The vector will be similar to a simple general vector in that the value of each slot can be any Lisp object and it cannot have a fill-pointer. The fact that a slot in a weak vector contains an object does not protect that object from being identified as garbage and scavenged (or global-gc'ed) away. (In contrast, if an object was the value of a slot of an ordinary vector which was not itself garbage, the object could not be garbage.) If the object is disposed of by the garbage collector, the value of the slot in any weak vectors pointing to it is changed to nil.

In addition to excl:weak-vector, common-lisp:make-array takes a :weak keyword argument, which defaults to nil. If specified t, a weak vector of the specified type is returned. It is an error to specify both :weak and :displaced-to.

As with a normal vector, the values of slots can be accessed with cl:aref and set with cl:setf used in conjunction with cl:aref.

See gc.htm for general information on garbage collection and 10.0 Weak vectors, finalizations, static arrays, etc. in that document for more on weak vectors.

The general documentation description is in introduction.htm. The index is in index.htm.

Copyright (C) 1998-1999, Franz Inc., Berkeley, CA. All Rights Reserved.