@item :size @var{size}
This specifies a hint for how many associations you plan to store in the
hash table. If you know the approximate number, you can make things a
-little more efficient by specifying it this way. If you specify too
-small a size, the hash table will grow automatically when necessary, but
-doing that takes some extra time.
-
-The default size is 65.
-
-@item :rehash-size @var{rehash-size}
-When you add an association to a hash table and the table is full,
-it grows automatically. This value specifies how to make the hash table
-larger, at that time.
-
-If @var{rehash-size} is an integer, it should be positive, and the hash
-table grows by adding approximately that much to the nominal size. If
-@var{rehash-size} is floating point, it had better be greater
-than 1, and the hash table grows by multiplying the old size by
-approximately that number.
-
-The default value is 1.5.
-
-@item :rehash-threshold @var{threshold}
-This specifies the criterion for when the hash table is full (so
-it should be made larger). The value, @var{threshold}, should be a
-positive floating-point number, no greater than 1. The hash table is
-full whenever the actual number of entries exceeds the nominal size
-multiplied by an approximation to this value. The default for
-@var{threshold} is 0.8125.
+little more efficient by specifying it this way but since the hash
+table memory is managed automatically, the gain in speed is rarely
+significant.
+
@end table
@end defun
(a symbol) and @code{300} (a number) respectively.
@example
-#s(hash-table size 30 data (key1 val1 key2 300))
+#s(hash-table data (key1 val1 key2 300))
@end example
Note, however, that when using this in Emacs Lisp code, it's
followed by a list beginning with @samp{hash-table}. The rest of the
list should consist of zero or more property-value pairs specifying
the hash table's properties and initial contents. The properties and
-values are read literally. Valid property names are @code{size},
-@code{test}, @code{weakness}, @code{rehash-size},
-@code{rehash-threshold}, and @code{data}. The @code{data} property
+values are read literally. Valid property names are @code{test},
+@code{weakness} and @code{data}. The @code{data} property
should be a list of key-value pairs for the initial contents; the
other properties have the same meanings as the matching
-@code{make-hash-table} keywords (@code{:size}, @code{:test}, etc.),
+@code{make-hash-table} keywords (@code{:test} and @code{:weakness}),
described above.
Note that you cannot specify a hash table whose initial contents
table @var{table}.
@end defun
-@defun hash-table-rehash-size table
-This returns the rehash size of @var{table}.
-@end defun
-
-@defun hash-table-rehash-threshold table
-This returns the rehash threshold of @var{table}.
-@end defun
-
@defun hash-table-size table
This returns the current allocation size of @var{table}. Since hash table
allocation is managed automatically, this is rarely of interest.
binding. The latter macro returns the connection-local value of a
variable if any, or its current value.
+** Hash tables
+
++++
+*** ':rehash-size' and ':rehash-threshold' args no longer have any effect.
+These keyword arguments are now ignored by 'make-hash-table'. Emacs
+manages the memory for all hash table objects in the same way.
+The functions 'hash-table-rehash-size' and 'hash-table-rehash-threshold'
+remain for compatibility but now always return the old default values.
+
++++
+*** The printed representation has been shrunk and simplified.
+The 'test' parameter is omitted if it is 'eql' (the default), as is
+'data' if empty. 'rehash-size', 'rehash-threshold' and 'size' are
+always omitted, and ignored if present when the object is read back in.
+
\f
* Changes in Emacs 30.1 on Non-Free Operating Systems
DEFUN ("hash-table-rehash-size", Fhash_table_rehash_size,
Shash_table_rehash_size, 1, 1, 0,
- doc: /* Return the current rehash size of TABLE. */)
+ doc: /* Return the rehash size of TABLE.
+This function is for compatibility only; it returns a nominal value
+without current significance. */)
(Lisp_Object table)
{
CHECK_HASH_TABLE (table);
- /* Nominal factor by which to increase the size of a hash table.
- No longer used; this is for compatibility. */
- return make_float (1.5);
+ return make_float (1.5); /* The old default rehash-size value. */
}
DEFUN ("hash-table-rehash-threshold", Fhash_table_rehash_threshold,
Shash_table_rehash_threshold, 1, 1, 0,
- doc: /* Return the current rehash threshold of TABLE. */)
+ doc: /* Return the rehash threshold of TABLE.
+This function is for compatibility only; it returns a nominal value
+without current significance. */)
(Lisp_Object table)
{
CHECK_HASH_TABLE (table);
- /* Nominal threshold for when to resize a hash table.
- No longer used; this is for compatibility. */
- return make_float (0.8125);
+ return make_float (0.8125); /* The old default rehash-threshold value. */
}