Mercurial > hg > xemacs-beta
diff man/lispref/hash-tables.texi @ 424:11054d720c21 r21-2-20
Import from CVS: tag r21-2-20
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:26:11 +0200 |
parents | 697ef44129c6 |
children |
line wrap: on
line diff
--- a/man/lispref/hash-tables.texi Mon Aug 13 11:25:03 2007 +0200 +++ b/man/lispref/hash-tables.texi Mon Aug 13 11:26:11 2007 +0200 @@ -72,19 +72,25 @@ (without the @code{:} character), as well as the additional keyword @code{data}, which specifies the initial hash table contents. -@defun make-hash-table &key @code{:size} @code{:test} @code{:type} @code{:rehash-size} @code{:rehash-threshold} +@defun make-hash-table &key @code{test} @code{size} @code{rehash-size} @code{rehash-threshold} @code{weakness} This function returns a new empty hash table object. -Keyword @code{:size} specifies the number of keys likely to be inserted. -This number of entries can be inserted without enlarging the hash table. - Keyword @code{:test} can be @code{eq}, @code{eql} (default) or @code{equal}. Comparison between keys is done using this function. If speed is important, consider using @code{eq}. When storing strings in the hash table, you will likely need to use @code{equal}. -Keyword @code{:type} can be @code{non-weak} (default), @code{weak}, -@code{key-weak} or @code{value-weak}. +Keyword @code{:size} specifies the number of keys likely to be inserted. +This number of entries can be inserted without enlarging the hash table. + +Keyword @code{:rehash-size} must be a float greater than 1.0, and specifies +the factor by which to increase the size of the hash table when enlarging. + +Keyword @code{:rehash-threshold} must be a float between 0.0 and 1.0, +and specifies the load factor of the hash table which triggers enlarging. + +Keyword @code{:weakness} can be @code{nil} (default), @code{t}, +@code{key} or @code{value}. A weak hash table is one whose pointers do not count as GC referents: for any key-value pair in the hash table, if the only remaining pointer @@ -104,12 +110,6 @@ unmarked outside of weak hash tables. The pair will remain in the hash table if the value is pointed to by something other than a weak hash table, even if the key is not. - -Keyword @code{:rehash-size} must be a float greater than 1.0, and specifies -the factor by which to increase the size of the hash table when enlarging. - -Keyword @code{:rehash-threshold} must be a float between 0.0 and 1.0, -and specifies the load factor of the hash table which triggers enlarging. @end defun @defun copy-hash-table hash-table @@ -122,22 +122,16 @@ This function returns the number of entries in @var{hash-table}. @end defun +@defun hash-table-test hash-table +This function returns the test function of @var{hash-table}. +This can be one of @code{eq}, @code{eql} or @code{equal}. +@end defun + @defun hash-table-size hash-table This function returns the current number of slots in @var{hash-table}, whether occupied or not. @end defun -@defun hash-table-type hash-table -This function returns the type of @var{hash-table}. -This can be one of @code{non-weak}, @code{weak}, @code{key-weak} or -@code{value-weak}. -@end defun - -@defun hash-table-test hash-table -This function returns the test function of @var{hash-table}. -This can be one of @code{eq}, @code{eql} or @code{equal}. -@end defun - @defun hash-table-rehash-size hash-table This function returns the current rehash size of @var{hash-table}. This is a float greater than 1.0; the factor by which @var{hash-table} @@ -150,6 +144,11 @@ @var{hash-table}, beyond which the @var{hash-table} is enlarged by rehashing. @end defun +@defun hash-table-weakness hash-table +This function returns the weakness of @var{hash-table}. +This can be one of @code{nil}, @code{t}, @code{key} or @code{value}. +@end defun + @node Working With Hash Tables @section Working With Hash Tables @@ -181,6 +180,7 @@ processed by @var{function}. @end defun + @node Weak Hash Tables @section Weak Hash Tables @cindex hash table, weak @@ -220,5 +220,5 @@ Also see @ref{Weak Lists}. -Weak hash tables are created by specifying the @code{:type} keyword to +Weak hash tables are created by specifying the @code{:weakness} keyword to @code{make-hash-table}.