Next Previous Up Top Contents Index

3.1 The Collections library

3.1.3 Weak tables

Common Dylan allows all general instances of the built-in class <table> to be weak. See "Weak tables" on page 4 of this volume for information about weakness.

You can create weak tables with the <table> class's weak: init-keyword. The legal values for this keyword are:

#"key"

Creates a table with weak keys. When there are no longer any strong references to a key, the table entry of which it is part becomes eligible for garbage collection.

#"value"

Creates a table with weak values. When there are no longer any strong references to a value, the table entry of which it is a part becomes eligible for garbage collection.

#f

Creates a table with strong keys and values. This is the default value.


Common Dylan and Functional Extensions - 31 Mar 00

Next Previous Up Top Contents Index