756 lines
No EOL
19 KiB
HTML
756 lines
No EOL
19 KiB
HTML
<!DOCTYPE HTML>
|
|
<HTML LANG="en-us"
|
|
><HEAD
|
|
><TITLE
|
|
>18.1 Hash Table Concepts | Common Lisp Nova Spec</TITLE
|
|
><META CHARSET="US-ASCII"
|
|
><LINK REL="canonical" HREF="18_1_Hash_Table_Concepts.html"
|
|
><LINK REL="next" HREF="18_2_Hash_Tables_Dictionary.html" TYPE="text/html" TITLE="18.2 Hash Tables Dictionary"
|
|
><LINK REL="prev" HREF="18_Hash_Tables.html" TYPE="text/html" TITLE="18. Hash Tables"
|
|
><LINK REL="up" HREF="18_Hash_Tables.html" TYPE="text/html" TITLE="18. Hash Tables"
|
|
><LINK REL="start" HREF="index.html" TYPE="text/html" TITLE="Common Lisp Nova Spec"
|
|
><META NAME="VIEWPORT" CONTENT="width=device-width, initial-scale=1.0"
|
|
><LINK REL="STYLESHEET" HREF="dpans.css%3F3909942064.css"
|
|
><SCRIPT SRC="dpans.js%3F3909942064"
|
|
></SCRIPT
|
|
><SCRIPT SRC="apropos.js%3F3909942064"
|
|
></SCRIPT
|
|
></HEAD
|
|
><BODY
|
|
><DIV
|
|
><DIV CLASS="topnav"
|
|
><DIV CLASS="breadcrumb"
|
|
><SPAN CLASS="breadcrumb-item"
|
|
><A HREF="index.html"
|
|
>Common Lisp Nova Spec</A
|
|
></SPAN
|
|
> <SPAN CLASS="breadcrumb-item"
|
|
>→ <A HREF="18_Hash_Tables.html"
|
|
>18. Hash Tables</A
|
|
></SPAN
|
|
> <SPAN CLASS="breadcrumb-item"
|
|
>→ <A HREF="18_1_Hash_Table_Concepts.html"
|
|
>18.1 Hash Table Concepts</A
|
|
></SPAN
|
|
></DIV
|
|
><DIV CLASS="apropos"
|
|
><DIV CLASS="apropos-io"
|
|
><A HREF="18_Hash_Tables.html" CLASS="prev"
|
|
>←</A
|
|
><SPAN ID="apropos-label"
|
|
>Apropos </SPAN
|
|
><INPUT ID="apropos" AUTOFOCUS="AUTOFOCUS" PLACEHOLDER="Type here to search" ONINPUT="aproposInput(this);" ONKEYUP="aproposKeyup(event);" ONCHANGE="aproposChange(this);" ONFOCUS="aproposFocus(this);" ONFOCUSOUT="aproposFocusout(this);"
|
|
><A HREF="18_2_Hash_Tables_Dictionary.html" CLASS="next"
|
|
>→</A
|
|
></DIV
|
|
><DIV ID="apropos-res"
|
|
></DIV
|
|
></DIV
|
|
></DIV
|
|
><DIV CLASS="matter"
|
|
><SECTION
|
|
><H2 ID="sec_18_1" CLASS="HeadII"
|
|
>18.1 Hash Table Concepts</H2
|
|
><UL CLASS="subtoc"
|
|
><LI
|
|
><A HREF="18_1_Hash_Table_Concepts.html#sec_18_1_1"
|
|
>18.1.1 Hash-Table Operations</A
|
|
></LI
|
|
><LI
|
|
><A HREF="18_1_Hash_Table_Concepts.html#sec_18_1_2"
|
|
>18.1.2 Modifying Hash Table Keys</A
|
|
></LI
|
|
><LI
|
|
><A HREF="18_1_Hash_Table_Concepts.html#sec_18_1_2_1"
|
|
>18.1.2.1 Visible Modification of Objects with respect to EQ and EQL</A
|
|
></LI
|
|
><LI
|
|
><A HREF="18_1_Hash_Table_Concepts.html#sec_18_1_2_2"
|
|
>18.1.2.2 Visible Modification of Objects with respect to EQUAL</A
|
|
></LI
|
|
><LI
|
|
><A HREF="18_1_Hash_Table_Concepts.html#sec_18_1_2_2_1"
|
|
>18.1.2.2.1 Visible Modification of Conses with respect to EQUAL</A
|
|
></LI
|
|
><LI
|
|
><A HREF="18_1_Hash_Table_Concepts.html#sec_18_1_2_2_2"
|
|
>18.1.2.2.2 Visible Modification of Bit Vectors and Strings with respect to EQUAL</A
|
|
></LI
|
|
><LI
|
|
><A HREF="18_1_Hash_Table_Concepts.html#sec_18_1_2_3"
|
|
>18.1.2.3 Visible Modification of Objects with respect to EQUALP</A
|
|
></LI
|
|
><LI
|
|
><A HREF="18_1_Hash_Table_Concepts.html#sec_18_1_2_3_1"
|
|
>18.1.2.3.1 Visible Modification of Structures with respect to EQUALP</A
|
|
></LI
|
|
><LI
|
|
><A HREF="18_1_Hash_Table_Concepts.html#sec_18_1_2_3_2"
|
|
>18.1.2.3.2 Visible Modification of Arrays with respect to EQUALP</A
|
|
></LI
|
|
><LI
|
|
><A HREF="18_1_Hash_Table_Concepts.html#sec_18_1_2_3_3"
|
|
>18.1.2.3.3 Visible Modification of Hash Tables with respect to EQUALP</A
|
|
></LI
|
|
><LI
|
|
><A HREF="18_1_Hash_Table_Concepts.html#sec_18_1_2_4"
|
|
>18.1.2.4 Visible Modifications by Language Extensions</A
|
|
></LI
|
|
></UL
|
|
><H3 ID="sec_18_1_1" CLASS="HeadIII"
|
|
>18.1.1 Hash-Table Operations</H3
|
|
><P CLASS="j"
|
|
>Figure 18–1 lists some <A HREF="26_1_Glossary.html#defined_name"
|
|
><EM CLASS="term"
|
|
>defined names</EM
|
|
></A
|
|
> that are applicable to <A HREF="26_1_Glossary.html#hash_table"
|
|
><EM CLASS="term"
|
|
>hash tables</EM
|
|
></A
|
|
>. The following rules apply to <A HREF="26_1_Glossary.html#hash_table"
|
|
><EM CLASS="term"
|
|
>hash tables</EM
|
|
></A
|
|
>.</P
|
|
><UL
|
|
><LI
|
|
><P CLASS="j"
|
|
>A <A HREF="26_1_Glossary.html#hash_table"
|
|
><EM CLASS="term"
|
|
>hash table</EM
|
|
></A
|
|
> can only associate one value with a given key. If an attempt is made to add a second value for a given key, the second value will replace the first. Thus, adding a value to a <A HREF="26_1_Glossary.html#hash_table"
|
|
><EM CLASS="term"
|
|
>hash table</EM
|
|
></A
|
|
> is a destructive operation; the <A HREF="26_1_Glossary.html#hash_table"
|
|
><EM CLASS="term"
|
|
>hash table</EM
|
|
></A
|
|
> is modified.</P
|
|
></LI
|
|
><LI
|
|
><P CLASS="j"
|
|
>There are four kinds of <A HREF="26_1_Glossary.html#hash_table"
|
|
><EM CLASS="term"
|
|
>hash tables</EM
|
|
></A
|
|
>: those whose keys are compared with <A HREF="f_eq.html" CLASS="funref"
|
|
><B
|
|
>eq</B
|
|
></A
|
|
>, those whose keys are compared with <A HREF="f_eql.html" CLASS="funref"
|
|
><B
|
|
>eql</B
|
|
></A
|
|
>, those whose keys are compared with <A HREF="f_equal.html" CLASS="funref"
|
|
><B
|
|
>equal</B
|
|
></A
|
|
>, and those whose keys are compared with <A HREF="f_equalp.html" CLASS="funref"
|
|
><B
|
|
>equalp</B
|
|
></A
|
|
>.</P
|
|
></LI
|
|
><LI
|
|
><P CLASS="j"
|
|
><A HREF="26_1_Glossary.html#hash_table"
|
|
><EM CLASS="term"
|
|
>Hash tables</EM
|
|
></A
|
|
> are created by <A HREF="f_make-hash-table.html" CLASS="funref"
|
|
><B
|
|
>make-hash-table</B
|
|
></A
|
|
>. <A HREF="f_gethash.html" CLASS="funref"
|
|
><B
|
|
>gethash</B
|
|
></A
|
|
> is used to look up a key and find the associated value. New entries are added to <A HREF="26_1_Glossary.html#hash_table"
|
|
><EM CLASS="term"
|
|
>hash tables</EM
|
|
></A
|
|
> using <A HREF="f_setf.html" CLASS="macref"
|
|
><B
|
|
>setf</B
|
|
></A
|
|
> with <A HREF="f_gethash.html" CLASS="funref"
|
|
><B
|
|
>gethash</B
|
|
></A
|
|
>. <A HREF="f_remhash.html" CLASS="funref"
|
|
><B
|
|
>remhash</B
|
|
></A
|
|
> is used to remove an entry. For example:</P
|
|
><PRE CLASS="screen"
|
|
>(setq a (make-hash-table)) <SPAN CLASS="cmsy"
|
|
><SPAN CLASS="arrow"
|
|
>→</SPAN
|
|
></SPAN
|
|
> #<HASH-TABLE EQL 0/120 32536573>
|
|
(setf (gethash 'color a) 'brown) <SPAN CLASS="cmsy"
|
|
><SPAN CLASS="arrow"
|
|
>→</SPAN
|
|
></SPAN
|
|
> BROWN
|
|
(setf (gethash 'name a) 'fred) <SPAN CLASS="cmsy"
|
|
><SPAN CLASS="arrow"
|
|
>→</SPAN
|
|
></SPAN
|
|
> FRED
|
|
(gethash 'color a) <SPAN CLASS="cmsy"
|
|
><SPAN CLASS="arrow"
|
|
>→</SPAN
|
|
></SPAN
|
|
> BROWN, <A HREF="26_1_Glossary.html#true"
|
|
><EM CLASS="term"
|
|
>true</EM
|
|
></A
|
|
>
|
|
(gethash 'name a) <SPAN CLASS="cmsy"
|
|
><SPAN CLASS="arrow"
|
|
>→</SPAN
|
|
></SPAN
|
|
> FRED, <A HREF="26_1_Glossary.html#true"
|
|
><EM CLASS="term"
|
|
>true</EM
|
|
></A
|
|
>
|
|
(gethash 'pointy a) <SPAN CLASS="cmsy"
|
|
><SPAN CLASS="arrow"
|
|
>→</SPAN
|
|
></SPAN
|
|
> NIL, <A HREF="26_1_Glossary.html#false"
|
|
><EM CLASS="term"
|
|
>false</EM
|
|
></A
|
|
></PRE
|
|
><P CLASS="j"
|
|
>In this example, the symbols <CODE CLASS="f"
|
|
>color</CODE
|
|
> and <CODE CLASS="f"
|
|
>name</CODE
|
|
> are being used as keys, and the symbols <CODE CLASS="f"
|
|
>brown</CODE
|
|
> and <CODE CLASS="f"
|
|
>fred</CODE
|
|
> are being used as the associated values. The <A HREF="26_1_Glossary.html#hash_table"
|
|
><EM CLASS="term"
|
|
>hash table</EM
|
|
></A
|
|
> has two items in it, one of which associates from <CODE CLASS="f"
|
|
>color</CODE
|
|
> to <CODE CLASS="f"
|
|
>brown</CODE
|
|
>, and the other of which associates from <CODE CLASS="f"
|
|
>name</CODE
|
|
> to <CODE CLASS="f"
|
|
>fred</CODE
|
|
>.</P
|
|
></LI
|
|
><LI
|
|
><P CLASS="j"
|
|
>A key or a value may be any <A HREF="26_1_Glossary.html#object"
|
|
><EM CLASS="term"
|
|
>object</EM
|
|
></A
|
|
>.</P
|
|
></LI
|
|
><LI
|
|
><P CLASS="j"
|
|
>The existence of an entry in the <A HREF="26_1_Glossary.html#hash_table"
|
|
><EM CLASS="term"
|
|
>hash table</EM
|
|
></A
|
|
> can be determined from the <A HREF="26_1_Glossary.html#secondary_value"
|
|
><EM CLASS="term"
|
|
>secondary value</EM
|
|
></A
|
|
> returned by <A HREF="f_gethash.html" CLASS="funref"
|
|
><B
|
|
>gethash</B
|
|
></A
|
|
>.</P
|
|
></LI
|
|
></UL
|
|
><DIV CLASS="displaythree"
|
|
><FIGURE CLASS="boxfig"
|
|
><DIV CLASS="figbody"
|
|
><TABLE CELLSPACING="0" CELLPADDING="0" RULES="GROUPS" STYLE="margin: 1ex 0" WIDTH="100%"
|
|
><TBODY
|
|
><TR
|
|
><TD ALIGN="LEFT" VALIGN="BASELINE" NOWRAP="NOWRAP" STYLE=";padding-right:1em"
|
|
><A HREF="f_clrhash.html" CLASS="misc"
|
|
><B
|
|
>clrhash</B
|
|
></A
|
|
></TD
|
|
><TD ALIGN="LEFT" VALIGN="BASELINE" NOWRAP="NOWRAP" STYLE="padding-left:1em;padding-right:1em"
|
|
> <A HREF="f_hash-table-p.html" CLASS="misc"
|
|
><B
|
|
>hash-table-p</B
|
|
></A
|
|
></TD
|
|
><TD ALIGN="LEFT" VALIGN="BASELINE" NOWRAP="NOWRAP" STYLE="padding-left:1em;"
|
|
> <A HREF="f_remhash.html" CLASS="misc"
|
|
><B
|
|
>remhash</B
|
|
></A
|
|
></TD
|
|
></TR
|
|
><TR
|
|
><TD ALIGN="LEFT" VALIGN="BASELINE" NOWRAP="NOWRAP" STYLE=";padding-right:1em"
|
|
> <A HREF="f_gethash.html" CLASS="misc"
|
|
><B
|
|
>gethash</B
|
|
></A
|
|
></TD
|
|
><TD ALIGN="LEFT" VALIGN="BASELINE" NOWRAP="NOWRAP" STYLE="padding-left:1em;padding-right:1em"
|
|
> <A HREF="f_make-hash-table.html" CLASS="misc"
|
|
><B
|
|
>make-hash-table</B
|
|
></A
|
|
></TD
|
|
><TD ALIGN="LEFT" VALIGN="BASELINE" NOWRAP="NOWRAP" STYLE="padding-left:1em;"
|
|
> <A HREF="f_sxhash.html" CLASS="misc"
|
|
><B
|
|
>sxhash</B
|
|
></A
|
|
></TD
|
|
></TR
|
|
><TR
|
|
><TD ALIGN="LEFT" VALIGN="BASELINE" NOWRAP="NOWRAP" STYLE=";padding-right:1em"
|
|
> <A HREF="f_hash-table-count.html" CLASS="misc"
|
|
><B
|
|
>hash-table-count</B
|
|
></A
|
|
></TD
|
|
><TD ALIGN="LEFT" VALIGN="BASELINE" NOWRAP="NOWRAP" STYLE="padding-left:1em;padding-right:1em"
|
|
> <A HREF="f_maphash.html" CLASS="misc"
|
|
><B
|
|
>maphash</B
|
|
></A
|
|
></TD
|
|
><TD ALIGN="LEFT" VALIGN="BASELINE" NOWRAP="NOWRAP" STYLE="padding-left:1em;"
|
|
><SPAN CLASS="misc"
|
|
></SPAN
|
|
></TD
|
|
></TR
|
|
></TBODY
|
|
></TABLE
|
|
></DIV
|
|
><FIGCAPTION CLASS="caption"
|
|
><B
|
|
>Figure 18–1. Hash-table defined names</B
|
|
></FIGCAPTION
|
|
></FIGURE
|
|
></DIV
|
|
><H3 ID="sec_18_1_2" CLASS="HeadIII"
|
|
>18.1.2 Modifying Hash Table Keys</H3
|
|
><P CLASS="j"
|
|
>The function supplied as the <SPAN CLASS="kwd"
|
|
><SPAN CLASS="cmtt"
|
|
>:test</SPAN
|
|
></SPAN
|
|
> argument to <A HREF="f_make-hash-table.html" CLASS="funref"
|
|
><B
|
|
>make-hash-table</B
|
|
></A
|
|
> specifies the ‘equivalence test’ for the <A HREF="26_1_Glossary.html#hash_table"
|
|
><EM CLASS="term"
|
|
>hash table</EM
|
|
></A
|
|
> it creates. </P
|
|
><P CLASS="j"
|
|
>An <A HREF="26_1_Glossary.html#object"
|
|
><EM CLASS="term"
|
|
>object</EM
|
|
></A
|
|
> is ‘visibly modified’ with regard to an equivalence test if there exists some set of <A HREF="26_1_Glossary.html#object"
|
|
><EM CLASS="term"
|
|
>objects</EM
|
|
></A
|
|
> (or potential <A HREF="26_1_Glossary.html#object"
|
|
><EM CLASS="term"
|
|
>objects</EM
|
|
></A
|
|
>) which are equivalent to the <A HREF="26_1_Glossary.html#object"
|
|
><EM CLASS="term"
|
|
>object</EM
|
|
></A
|
|
> before the modification but are no longer equivalent afterwards. </P
|
|
><P CLASS="j"
|
|
>If an <A HREF="26_1_Glossary.html#object"
|
|
><EM CLASS="term"
|
|
>object</EM
|
|
></A
|
|
> <I
|
|
>O</I
|
|
><SUB CLASS="sub"
|
|
><SPAN CLASS="cmr"
|
|
>1</SPAN
|
|
></SUB
|
|
> is used as a key in a <A HREF="26_1_Glossary.html#hash_table"
|
|
><EM CLASS="term"
|
|
>hash table</EM
|
|
></A
|
|
> <I
|
|
>H</I
|
|
> and is then visibly modified with regard to the equivalence test of <I
|
|
>H</I
|
|
>, then the consequences are unspecified if <I
|
|
>O</I
|
|
><SUB CLASS="sub"
|
|
><SPAN CLASS="cmr"
|
|
>1</SPAN
|
|
></SUB
|
|
>, or any <A HREF="26_1_Glossary.html#object"
|
|
><EM CLASS="term"
|
|
>object</EM
|
|
></A
|
|
> <I
|
|
>O</I
|
|
><SUB CLASS="sub"
|
|
><SPAN CLASS="cmr"
|
|
>2</SPAN
|
|
></SUB
|
|
> equivalent to <I
|
|
>O</I
|
|
><SUB CLASS="sub"
|
|
><SPAN CLASS="cmr"
|
|
>1</SPAN
|
|
></SUB
|
|
> under the equivalence test (either before or after the modification), is used as a key in further operations on <I
|
|
>H</I
|
|
>. The consequences of using <I
|
|
>O</I
|
|
><SUB CLASS="sub"
|
|
><SPAN CLASS="cmr"
|
|
>1</SPAN
|
|
></SUB
|
|
> as a key are unspecified even if <I
|
|
>O</I
|
|
><SUB CLASS="sub"
|
|
><SPAN CLASS="cmr"
|
|
>1</SPAN
|
|
></SUB
|
|
> is visibly modified and then later modified again in such a way as to undo the visible modification. </P
|
|
><P CLASS="j"
|
|
>Following are specifications of the modifications which are visible to the equivalence tests which must be supported by <A HREF="26_1_Glossary.html#hash_table"
|
|
><EM CLASS="term"
|
|
>hash tables</EM
|
|
></A
|
|
>. The modifications are described in terms of modification of components, and are defined recursively. Visible modifications of components of the <A HREF="26_1_Glossary.html#object"
|
|
><EM CLASS="term"
|
|
>object</EM
|
|
></A
|
|
> are visible modifications of the <A HREF="26_1_Glossary.html#object"
|
|
><EM CLASS="term"
|
|
>object</EM
|
|
></A
|
|
>.</P
|
|
><H4 ID="sec_18_1_2_1" CLASS="HeadIV"
|
|
>18.1.2.1 Visible Modification of Objects with respect to EQ and EQL</H4
|
|
><P CLASS="j"
|
|
>No <A HREF="26_1_Glossary.html#standardized"
|
|
><EM CLASS="term"
|
|
>standardized</EM
|
|
></A
|
|
> <A HREF="26_1_Glossary.html#function"
|
|
><EM CLASS="term"
|
|
>function</EM
|
|
></A
|
|
> is provided that is capable of visibly modifying an <A HREF="26_1_Glossary.html#object"
|
|
><EM CLASS="term"
|
|
>object</EM
|
|
></A
|
|
> with regard to <A HREF="f_eq.html" CLASS="funref"
|
|
><B
|
|
>eq</B
|
|
></A
|
|
> or <A HREF="f_eql.html" CLASS="funref"
|
|
><B
|
|
>eql</B
|
|
></A
|
|
>.</P
|
|
><H4 ID="sec_18_1_2_2" CLASS="HeadIV"
|
|
>18.1.2.2 Visible Modification of Objects with respect to EQUAL</H4
|
|
><P CLASS="j"
|
|
>As a consequence of the behavior for <A HREF="f_equal.html" CLASS="funref"
|
|
><B
|
|
>equal</B
|
|
></A
|
|
>, the rules for visible modification of <A HREF="26_1_Glossary.html#object"
|
|
><EM CLASS="term"
|
|
>objects</EM
|
|
></A
|
|
> not explicitly mentioned in this section are inherited from those in <A HREF="18_1_Hash_Table_Concepts.html#sec_18_1_2_1" CLASS="secref"
|
|
><SPAN CLASS="cmr"
|
|
>Section</SPAN
|
|
> <SPAN CLASS="cmr"
|
|
>18.1.2.1</SPAN
|
|
> <SPAN CLASS="cmr"
|
|
>(Visible</SPAN
|
|
> <SPAN CLASS="cmr"
|
|
>Modification</SPAN
|
|
> <SPAN CLASS="cmr"
|
|
>of</SPAN
|
|
> <SPAN CLASS="cmr"
|
|
>Objects</SPAN
|
|
> <SPAN CLASS="cmr"
|
|
>with</SPAN
|
|
> <SPAN CLASS="cmr"
|
|
>respect</SPAN
|
|
> <SPAN CLASS="cmr"
|
|
>to</SPAN
|
|
> <SPAN CLASS="cmr"
|
|
>EQ</SPAN
|
|
> <SPAN CLASS="cmr"
|
|
>and</SPAN
|
|
> <SPAN CLASS="cmr"
|
|
>EQL)</SPAN
|
|
></A
|
|
>.</P
|
|
><H5 ID="sec_18_1_2_2_1" CLASS="HeadV"
|
|
>18.1.2.2.1 Visible Modification of Conses with respect to EQUAL</H5
|
|
><P CLASS="j"
|
|
>Any visible change to the <A HREF="26_1_Glossary.html#car"
|
|
><EM CLASS="term"
|
|
>car</EM
|
|
></A
|
|
> or the <A HREF="26_1_Glossary.html#cdr"
|
|
><EM CLASS="term"
|
|
>cdr</EM
|
|
></A
|
|
> of a <A HREF="26_1_Glossary.html#cons"
|
|
><EM CLASS="term"
|
|
>cons</EM
|
|
></A
|
|
> is considered a visible modification with regard to <A HREF="f_equal.html" CLASS="funref"
|
|
><B
|
|
>equal</B
|
|
></A
|
|
>.</P
|
|
><H5 ID="sec_18_1_2_2_2" CLASS="HeadV"
|
|
>18.1.2.2.2 Visible Modification of Bit Vectors and Strings with respect to EQUAL</H5
|
|
><P CLASS="j"
|
|
>For a <A HREF="26_1_Glossary.html#vector"
|
|
><EM CLASS="term"
|
|
>vector</EM
|
|
></A
|
|
> of <A HREF="26_1_Glossary.html#type"
|
|
><EM CLASS="term"
|
|
>type</EM
|
|
></A
|
|
> <A HREF="t_bit-vector.html" CLASS="typeref"
|
|
><B
|
|
>bit-vector</B
|
|
></A
|
|
> or of <A HREF="26_1_Glossary.html#type"
|
|
><EM CLASS="term"
|
|
>type</EM
|
|
></A
|
|
> <A HREF="t_string.html" CLASS="typeref"
|
|
><B
|
|
>string</B
|
|
></A
|
|
>, any visible change to an <A HREF="26_1_Glossary.html#active"
|
|
><EM CLASS="term"
|
|
>active</EM
|
|
></A
|
|
> <A HREF="26_1_Glossary.html#element"
|
|
><EM CLASS="term"
|
|
>element</EM
|
|
></A
|
|
> of the <A HREF="26_1_Glossary.html#vector"
|
|
><EM CLASS="term"
|
|
>vector</EM
|
|
></A
|
|
>, or to the <A HREF="26_1_Glossary.html#length"
|
|
><EM CLASS="term"
|
|
>length</EM
|
|
></A
|
|
> of the <A HREF="26_1_Glossary.html#vector"
|
|
><EM CLASS="term"
|
|
>vector</EM
|
|
></A
|
|
> (if it is <A HREF="26_1_Glossary.html#actually_adjustable"
|
|
><EM CLASS="term"
|
|
>actually adjustable</EM
|
|
></A
|
|
> or has a <A HREF="26_1_Glossary.html#fill_pointer"
|
|
><EM CLASS="term"
|
|
>fill pointer</EM
|
|
></A
|
|
>) is considered a visible modification with regard to <A HREF="f_equal.html" CLASS="funref"
|
|
><B
|
|
>equal</B
|
|
></A
|
|
>.</P
|
|
><H4 ID="sec_18_1_2_3" CLASS="HeadIV"
|
|
>18.1.2.3 Visible Modification of Objects with respect to EQUALP</H4
|
|
><P CLASS="j"
|
|
>As a consequence of the behavior for <A HREF="f_equalp.html" CLASS="funref"
|
|
><B
|
|
>equalp</B
|
|
></A
|
|
>, the rules for visible modification of <A HREF="26_1_Glossary.html#object"
|
|
><EM CLASS="term"
|
|
>objects</EM
|
|
></A
|
|
> not explicitly mentioned in this section are inherited from those in <A HREF="18_1_Hash_Table_Concepts.html#sec_18_1_2_2" CLASS="secref"
|
|
><SPAN CLASS="cmr"
|
|
>Section</SPAN
|
|
> <SPAN CLASS="cmr"
|
|
>18.1.2.2</SPAN
|
|
> <SPAN CLASS="cmr"
|
|
>(Visible</SPAN
|
|
> <SPAN CLASS="cmr"
|
|
>Modification</SPAN
|
|
> <SPAN CLASS="cmr"
|
|
>of</SPAN
|
|
> <SPAN CLASS="cmr"
|
|
>Objects</SPAN
|
|
> <SPAN CLASS="cmr"
|
|
>with</SPAN
|
|
> <SPAN CLASS="cmr"
|
|
>respect</SPAN
|
|
> <SPAN CLASS="cmr"
|
|
>to</SPAN
|
|
> <SPAN CLASS="cmr"
|
|
>EQUAL)</SPAN
|
|
></A
|
|
>.</P
|
|
><H5 ID="sec_18_1_2_3_1" CLASS="HeadV"
|
|
>18.1.2.3.1 Visible Modification of Structures with respect to EQUALP</H5
|
|
><P CLASS="j"
|
|
>Any visible change to a <A HREF="26_1_Glossary.html#slot"
|
|
><EM CLASS="term"
|
|
>slot</EM
|
|
></A
|
|
> of a <A HREF="26_1_Glossary.html#structure"
|
|
><EM CLASS="term"
|
|
>structure</EM
|
|
></A
|
|
> is considered a visible modification with regard to <A HREF="f_equalp.html" CLASS="funref"
|
|
><B
|
|
>equalp</B
|
|
></A
|
|
>.</P
|
|
><H5 ID="sec_18_1_2_3_2" CLASS="HeadV"
|
|
>18.1.2.3.2 Visible Modification of Arrays with respect to EQUALP</H5
|
|
><P CLASS="j"
|
|
>In an <A HREF="26_1_Glossary.html#array"
|
|
><EM CLASS="term"
|
|
>array</EM
|
|
></A
|
|
>, any visible change to an <A HREF="26_1_Glossary.html#active"
|
|
><EM CLASS="term"
|
|
>active</EM
|
|
></A
|
|
> <A HREF="26_1_Glossary.html#element"
|
|
><EM CLASS="term"
|
|
>element</EM
|
|
></A
|
|
>, to the <A HREF="26_1_Glossary.html#fill_pointer"
|
|
><EM CLASS="term"
|
|
>fill pointer</EM
|
|
></A
|
|
> (if the <A HREF="26_1_Glossary.html#array"
|
|
><EM CLASS="term"
|
|
>array</EM
|
|
></A
|
|
> can and does have one), or to the <A HREF="26_1_Glossary.html#dimension"
|
|
><EM CLASS="term"
|
|
>dimensions</EM
|
|
></A
|
|
> (if the <A HREF="26_1_Glossary.html#array"
|
|
><EM CLASS="term"
|
|
>array</EM
|
|
></A
|
|
> is <A HREF="26_1_Glossary.html#actually_adjustable"
|
|
><EM CLASS="term"
|
|
>actually adjustable</EM
|
|
></A
|
|
>) is considered a visible modification with regard to <A HREF="f_equalp.html" CLASS="funref"
|
|
><B
|
|
>equalp</B
|
|
></A
|
|
>.</P
|
|
><H5 ID="sec_18_1_2_3_3" CLASS="HeadV"
|
|
>18.1.2.3.3 Visible Modification of Hash Tables with respect to EQUALP</H5
|
|
><P CLASS="j"
|
|
>In a <A HREF="26_1_Glossary.html#hash_table"
|
|
><EM CLASS="term"
|
|
>hash table</EM
|
|
></A
|
|
>, any visible change to the count of entries in the <A HREF="26_1_Glossary.html#hash_table"
|
|
><EM CLASS="term"
|
|
>hash table</EM
|
|
></A
|
|
>, to the keys, or to the values associated with the keys is considered a visible modification with regard to <A HREF="f_equalp.html" CLASS="funref"
|
|
><B
|
|
>equalp</B
|
|
></A
|
|
>. </P
|
|
><P CLASS="j"
|
|
>Note that the visibility of modifications to the keys depends on the equivalence test of the <A HREF="26_1_Glossary.html#hash_table"
|
|
><EM CLASS="term"
|
|
>hash table</EM
|
|
></A
|
|
>, not on the specification of <A HREF="f_equalp.html" CLASS="funref"
|
|
><B
|
|
>equalp</B
|
|
></A
|
|
>.</P
|
|
><H4 ID="sec_18_1_2_4" CLASS="HeadIV"
|
|
>18.1.2.4 Visible Modifications by Language Extensions</H4
|
|
><P CLASS="j"
|
|
><A HREF="26_1_Glossary.html#implementation"
|
|
><EM CLASS="term"
|
|
>Implementations</EM
|
|
></A
|
|
> that extend the language by providing additional mutator functions (or additional behavior for existing mutator functions) must document how the use of these extensions interacts with equivalence tests and <A HREF="26_1_Glossary.html#hash_table"
|
|
><EM CLASS="term"
|
|
>hash table</EM
|
|
></A
|
|
> searches. </P
|
|
><P CLASS="j"
|
|
><A HREF="26_1_Glossary.html#implementation"
|
|
><EM CLASS="term"
|
|
>Implementations</EM
|
|
></A
|
|
> that extend the language by defining additional acceptable equivalence tests for <A HREF="26_1_Glossary.html#hash_table"
|
|
><EM CLASS="term"
|
|
>hash tables</EM
|
|
></A
|
|
> (allowing additional values for the <SPAN CLASS="kwd"
|
|
><SPAN CLASS="cmtt"
|
|
>:test</SPAN
|
|
></SPAN
|
|
> argument to <A HREF="f_make-hash-table.html" CLASS="funref"
|
|
><B
|
|
>make-hash-table</B
|
|
></A
|
|
>) must document the visible components of these tests.</P
|
|
></SECTION
|
|
></DIV
|
|
><DIV CLASS="footer"
|
|
><DIV CLASS="btmnav"
|
|
><A HREF="18_Hash_Tables.html" CLASS="prev"
|
|
>←</A
|
|
><A HREF="18_2_Hash_Tables_Dictionary.html" CLASS="next"
|
|
>→</A
|
|
></DIV
|
|
><DIV CLASS="trail"
|
|
>Conversion to HTML copyright 2023 by Gilbert Baumann</DIV
|
|
></DIV
|
|
></DIV
|
|
><SCRIPT
|
|
>domReady();</SCRIPT
|
|
></BODY
|
|
></HTML
|
|
> |