summaryrefslogtreecommitdiff
path: root/devdocs/elisp/hash-tables.html
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2024-04-07 13:41:34 -0500
committerCraig Jennings <c@cjennings.net>2024-04-07 13:41:34 -0500
commit754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 (patch)
treef1190704f78f04a2b0b4c977d20fe96a828377f1 /devdocs/elisp/hash-tables.html
new repository
Diffstat (limited to 'devdocs/elisp/hash-tables.html')
-rw-r--r--devdocs/elisp/hash-tables.html29
1 files changed, 29 insertions, 0 deletions
diff --git a/devdocs/elisp/hash-tables.html b/devdocs/elisp/hash-tables.html
new file mode 100644
index 00000000..ebdabe4d
--- /dev/null
+++ b/devdocs/elisp/hash-tables.html
@@ -0,0 +1,29 @@
+ <h2 class="chapter">Hash Tables</h2> <p>A hash table is a very fast kind of lookup table, somewhat like an alist (see <a href="association-lists">Association Lists</a>) in that it maps keys to corresponding values. It differs from an alist in these ways: </p> <ul> <li> Lookup in a hash table is extremely fast for large tables—in fact, the time required is essentially <em>independent</em> of how many elements are stored in the table. For smaller tables (a few tens of elements) alists may still be faster because hash tables have a more-or-less constant overhead. </li>
+<li> The correspondences in a hash table are in no particular order. </li>
+<li> There is no way to share structure between two hash tables, the way two alists can share a common tail. </li>
+</ul> <p>Emacs Lisp provides a general-purpose hash table data type, along with a series of functions for operating on them. Hash tables have a special printed representation, which consists of ‘<samp>#s</samp>’ followed by a list specifying the hash table properties and contents. See <a href="creating-hash">Creating Hash</a>. (Hash notation, the initial ‘<samp>#</samp>’ character used in the printed representations of objects with no read representation, has nothing to do with hash tables. See <a href="printed-representation">Printed Representation</a>.) </p> <p>Obarrays are also a kind of hash table, but they are a different type of object and are used only for recording interned symbols (see <a href="creating-symbols">Creating Symbols</a>). </p> <table class="menu" border="0" cellspacing="0"> <tr>
+<td align="left" valign="top">• <a href="creating-hash" accesskey="1">Creating Hash</a>
+</td>
+<td> </td>
+<td align="left" valign="top">Functions to create hash tables. </td>
+</tr> <tr>
+<td align="left" valign="top">• <a href="hash-access" accesskey="2">Hash Access</a>
+</td>
+<td> </td>
+<td align="left" valign="top">Reading and writing the hash table contents. </td>
+</tr> <tr>
+<td align="left" valign="top">• <a href="defining-hash" accesskey="3">Defining Hash</a>
+</td>
+<td> </td>
+<td align="left" valign="top">Defining new comparison methods. </td>
+</tr> <tr>
+<td align="left" valign="top">• <a href="other-hash" accesskey="4">Other Hash</a>
+</td>
+<td> </td>
+<td align="left" valign="top">Miscellaneous. </td>
+</tr> </table><div class="_attribution">
+ <p class="_attribution-p">
+ Copyright &copy; 1990-1996, 1998-2022 Free Software Foundation, Inc. <br>Licensed under the GNU GPL license.<br>
+ <a href="https://www.gnu.org/software/emacs/manual/html_node/elisp/Hash-Tables.html" class="_attribution-link">https://www.gnu.org/software/emacs/manual/html_node/elisp/Hash-Tables.html</a>
+ </p>
+</div>