FunctionPackage: exclToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 10.1
Unrevised from 10.0 to 10.1.
10.0 version

weak-vector

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 weak-vector, 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 aref and set with setf used in conjunction with aref.

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


Copyright (c) 1998-2022, Franz Inc. Lafayette, CA., USA. All rights reserved.
This page was not revised from the 10.0 page.
Created 2019.8.20.

ToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 10.1
Unrevised from 10.0 to 10.1.
10.0 version