diff options
| author | Paul Eggert | 2019-07-21 11:20:07 -0700 |
|---|---|---|
| committer | Paul Eggert | 2019-07-21 11:24:11 -0700 |
| commit | cf285946bee56912286f75e4d1215214bc7c5b4b (patch) | |
| tree | 7d2e8c14783d757b1af8998b0654ce3622bbdc07 /src | |
| parent | 4a1507b88e813e3d54614f4cb59211234e05334a (diff) | |
| download | emacs-cf285946bee56912286f75e4d1215214bc7c5b4b.tar.gz emacs-cf285946bee56912286f75e4d1215214bc7c5b4b.zip | |
Improve doc for hash tables
* doc/lispref/hash.texi (Creating Hash, Defining Hash):
* src/fns.c (Fsxhash_eq, Fsxhash_eql, Fsxhash_equal):
Say that hashes are fixnums.
(Fmake_hash_table): Say that that an integer rehash-size
should be a fixnum.
* doc/lispref/hash.texi (Defining Hash): Say that hash and
comparison functions should be consistent and pure, and should
return quickly.
Diffstat (limited to 'src')
| -rw-r--r-- | src/fns.c | 8 |
1 files changed, 4 insertions, 4 deletions
| @@ -4700,7 +4700,7 @@ sxhash (Lisp_Object obj, int depth) | |||
| 4700 | ***********************************************************************/ | 4700 | ***********************************************************************/ |
| 4701 | 4701 | ||
| 4702 | DEFUN ("sxhash-eq", Fsxhash_eq, Ssxhash_eq, 1, 1, 0, | 4702 | DEFUN ("sxhash-eq", Fsxhash_eq, Ssxhash_eq, 1, 1, 0, |
| 4703 | doc: /* Return an integer hash code for OBJ suitable for `eq'. | 4703 | doc: /* Return a fixnum hash code for OBJ suitable for `eq'. |
| 4704 | If (eq A B), then (= (sxhash-eq A) (sxhash-eq B)). | 4704 | If (eq A B), then (= (sxhash-eq A) (sxhash-eq B)). |
| 4705 | 4705 | ||
| 4706 | Hash codes are not guaranteed to be preserved across Emacs sessions. */) | 4706 | Hash codes are not guaranteed to be preserved across Emacs sessions. */) |
| @@ -4710,7 +4710,7 @@ Hash codes are not guaranteed to be preserved across Emacs sessions. */) | |||
| 4710 | } | 4710 | } |
| 4711 | 4711 | ||
| 4712 | DEFUN ("sxhash-eql", Fsxhash_eql, Ssxhash_eql, 1, 1, 0, | 4712 | DEFUN ("sxhash-eql", Fsxhash_eql, Ssxhash_eql, 1, 1, 0, |
| 4713 | doc: /* Return an integer hash code for OBJ suitable for `eql'. | 4713 | doc: /* Return a fixnum hash code for OBJ suitable for `eql'. |
| 4714 | If (eql A B), then (= (sxhash-eql A) (sxhash-eql B)). | 4714 | If (eql A B), then (= (sxhash-eql A) (sxhash-eql B)). |
| 4715 | 4715 | ||
| 4716 | Hash codes are not guaranteed to be preserved across Emacs sessions. */) | 4716 | Hash codes are not guaranteed to be preserved across Emacs sessions. */) |
| @@ -4720,7 +4720,7 @@ Hash codes are not guaranteed to be preserved across Emacs sessions. */) | |||
| 4720 | } | 4720 | } |
| 4721 | 4721 | ||
| 4722 | DEFUN ("sxhash-equal", Fsxhash_equal, Ssxhash_equal, 1, 1, 0, | 4722 | DEFUN ("sxhash-equal", Fsxhash_equal, Ssxhash_equal, 1, 1, 0, |
| 4723 | doc: /* Return an integer hash code for OBJ suitable for `equal'. | 4723 | doc: /* Return a fixnum hash code for OBJ suitable for `equal'. |
| 4724 | If (equal A B), then (= (sxhash-equal A) (sxhash-equal B)). | 4724 | If (equal A B), then (= (sxhash-equal A) (sxhash-equal B)). |
| 4725 | 4725 | ||
| 4726 | Hash codes are not guaranteed to be preserved across Emacs sessions. */) | 4726 | Hash codes are not guaranteed to be preserved across Emacs sessions. */) |
| @@ -4744,7 +4744,7 @@ keys. Default is `eql'. Predefined are the tests `eq', `eql', and | |||
| 4744 | Default is 65. | 4744 | Default is 65. |
| 4745 | 4745 | ||
| 4746 | :rehash-size REHASH-SIZE - Indicates how to expand the table when it | 4746 | :rehash-size REHASH-SIZE - Indicates how to expand the table when it |
| 4747 | fills up. If REHASH-SIZE is an integer, increase the size by that | 4747 | fills up. If REHASH-SIZE is a fixnum, increase the size by that |
| 4748 | amount. If it is a float, it must be > 1.0, and the new size is the | 4748 | amount. If it is a float, it must be > 1.0, and the new size is the |
| 4749 | old size multiplied by that factor. Default is 1.5. | 4749 | old size multiplied by that factor. Default is 1.5. |
| 4750 | 4750 | ||