diff options
| author | Richard M. Stallman | 2004-02-17 00:47:11 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2004-02-17 00:47:11 +0000 |
| commit | 2c6d3eef11acac0a260c00b98bde7410b9ea94c7 (patch) | |
| tree | 180bc897aad99e6ac98a30f2ab1019f5900c4e19 | |
| parent | 0fe5963523fd53826a281f97fd3b19fbec0f93d6 (diff) | |
| download | emacs-2c6d3eef11acac0a260c00b98bde7410b9ea94c7.tar.gz emacs-2c6d3eef11acac0a260c00b98bde7410b9ea94c7.zip | |
(Creating Hash): Correct and clarify doc of WEAK values.
| -rw-r--r-- | lispref/hash.texi | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/lispref/hash.texi b/lispref/hash.texi index 909c7fb0b7c..3c4cb4df19c 100644 --- a/lispref/hash.texi +++ b/lispref/hash.texi | |||
| @@ -109,19 +109,19 @@ values from being collected as garbage (if they are not referenced | |||
| 109 | anywhere else); if a particular value does get collected, the | 109 | anywhere else); if a particular value does get collected, the |
| 110 | corresponding association is removed from the hash table. | 110 | corresponding association is removed from the hash table. |
| 111 | 111 | ||
| 112 | If @var{weak} is @code{key-or-value} or @code{t}, the hash table does | 112 | If @var{weak} is @code{key-and-value} or @code{t}, both the key and |
| 113 | not protect either keys or values from garbage collection; if either | 113 | the value must be live in order to preserve the association. Thus, |
| 114 | one is collected as garbage, the association is removed. | 114 | the hash table does not protect either keys or values from garbage |
| 115 | collection; if either one is collected as garbage, that removes the | ||
| 116 | association. | ||
| 115 | 117 | ||
| 116 | If @var{weak} is @code{key-and-value}, associations are removed from | 118 | If @var{weak} is @code{key-or-value}, either the key or |
| 117 | the hash table when both their key and value would be collected as | 119 | the value can preserve the association. Thus, associations are |
| 118 | garbage, again not considering references to the key and value from | 120 | removed from the hash table when both their key and value would be |
| 119 | weak hash tables. | 121 | collected as garbage (if not for references from weak hash tables). |
| 120 | 122 | ||
| 121 | The default for @var{weak} is @code{nil}, so that all keys and values | 123 | The default for @var{weak} is @code{nil}, so that all keys and values |
| 122 | referenced in the hash table are preserved from garbage collection. If | 124 | referenced in the hash table are preserved from garbage collection. |
| 123 | @var{weak} is @code{t}, neither keys nor values are protected (that is, | ||
| 124 | both are weak). | ||
| 125 | 125 | ||
| 126 | @item :size @var{size} | 126 | @item :size @var{size} |
| 127 | This specifies a hint for how many associations you plan to store in the | 127 | This specifies a hint for how many associations you plan to store in the |