comparison lispref/hash.texi @ 30524:62ed067637af

*** empty log message ***
author Gerd Moellmann <gerd@gnu.org>
date Sun, 30 Jul 2000 11:50:38 +0000
parents ed440ffea308
children 4d3fd773cd30
comparison
equal deleted inserted replaced
30523:87bca20b7a83 30524:62ed067637af
93 @item :weakness @var{weak} 93 @item :weakness @var{weak}
94 The weakness of a hash table specifies whether the presence of a key or 94 The weakness of a hash table specifies whether the presence of a key or
95 value in the hash table preserves it from garbage collection. 95 value in the hash table preserves it from garbage collection.
96 96
97 The value, @var{weak}, must be one of @code{nil}, @code{key}, 97 The value, @var{weak}, must be one of @code{nil}, @code{key},
98 @code{value} or @code{t}. If @var{weak} is @code{key} or @code{t}, then 98 @code{value}, @code{key-or-value}, @code{key-and-value}, or @code{t}
99 the hash table does not prevent its keys from being collected as garbage 99 which is an alias for @code{key-and-value}. If @var{weak} is @code{key}
100 (if they are not referenced anywhere else); if a particular key does get 100 then the hash table does not prevent its keys from being collected as
101 collected, the corresponding association is removed from the hash table. 101 garbage (if they are not referenced anywhere else); if a particular key
102 102 does get collected, the corresponding association is removed from the
103 Likewise, if @var{weak} is @code{value} or @code{t}, then the hash table 103 hash table.
104 does not prevent values from being collected as garbage (if they are not 104
105 referenced anywhere else); if a particular value does get collected, the 105 If @var{weak} is @code{value}, then the hash table does not prevent
106 values from being collected as garbage (if they are not referenced
107 anywhere else); if a particular value does get collected, the
106 corresponding association is removed from the hash table. 108 corresponding association is removed from the hash table.
109
110 If @var{weak} is @code{key-or-value}, associations are removed from the
111 hash table when either their key or their value part would be collected
112 as garbage, not counting references to the key and value from weak hash
113 tables. Likewise, if @var{weak} is @code{key-and-value}, associations
114 are removed from the hash table when both their key and value would be
115 collected as garbage, again not considering references to the key and
116 value from weak hash tables.
107 117
108 The default for @var{weak} is @code{nil}, so that all keys and values 118 The default for @var{weak} is @code{nil}, so that all keys and values
109 referenced in the hash table are preserved from garbage collection. If 119 referenced in the hash table are preserved from garbage collection. If
110 @var{weak} is @code{t}, neither keys nor values are protected (that is, 120 @var{weak} is @code{t}, neither keys nor values are protected (that is,
111 both are weak). 121 both are weak).