Next: iklib lists queue, Up: iklib lists [Index]
Weak references do not cause the referenced value to be considered used
by the garbage collector. The following bindings are exported by the
library (vicare)
.
Like cons
build and return a new pair, but holding weak
references to A; notice that the reference to D is not weak.
This function allows to build a non–weak list spine holding weak
references to values.
Return true if obj is a weak pair.
Return the BWP object. BWP stands for “broken weak pointer”.
Return true if obj is a weak reference to a value which has been already garbage collected. Example:
vicare> (define x (weak-cons (cons 1 2) #f)) vicare> x ((1 . 2) . #f) vicare> (bwp-object? (car x)) #f vicare> (collect) vicare> x (#!bwp . #f) vicare> (bwp-object? (car x)) #t