Used to define a cleanup function that is called after the shaking operation.
stores a pointer to
and a weak pointer to
. After the shaking, the shaker goes through all the object/function pairs, and for each object that is still alive, calls this function with the object as argument. This is used to perform operations that are dependent on the results of the shaking operation.
If the cleanup function has to be called unconditionally, the object should be
. The cleanup function should be a symbol or compiled function/closure, unless the evaluator is kept via
. The shaker performs another round of shaking after calling the cleanup functions, so unless something points to them, they are shaken away before the delivered image is saved. This also means that objects (including symbols) that survived the shaking until the cleanup function is called, but become garbage as a result of the cleanup function, are shaken away as well.
The cleanup function
. If the value of one of the keywords to
is needed in the cleanup function, it has to be stored somewhere (for example, as a value of a symbol, or closed over). It
be bound dynamically around the call to
, because the cleanup function is executed outside the dynamic context in which
Suppose the symbol P:X is referred to by objects that are not shaken, but its values are used in function P:Y, which may or may not be shaken. We want to get rid of the value of P:X if the symbol P:Y has been shaken, and set the value of P:X to T if
is passed to
and is non-
delivery-valueitself. Instead, it closes over the value.