1
0
Fork 0
cl-sites/HyperSpec-7-0/HyperSpec/Issues/iss186_w.htm
2024-04-01 10:24:07 +02:00

109 lines
6.1 KiB
HTML

<!-- Common Lisp HyperSpec (TM), version 7.0 generated by Kent M. Pitman on Mon, 11-Apr-2005 2:31am EDT -->
<HTML>
<HEAD>
<TITLE>CLHS: Issue HASH-TABLE-ACCESS Writeup</TITLE>
<LINK HREF="../Data/clhs.css" REL="stylesheet" TYPE="text/css" />
<META HTTP-EQUIV="Author" CONTENT="Kent M. Pitman">
<META HTTP-EQUIV="Organization" CONTENT="LispWorks Ltd.">
<LINK REL=TOP HREF="../Front/index.htm">
<LINK REL=COPYRIGHT HREF="../Front/Help.htm#Legal">
<LINK REL=DISCLAIMER HREF="../Front/Help.htm#Disclaimer">
<LINK REL=PREV HREF="../Issues/iss185_w.htm">
<LINK REL=UP HREF="../Issues/iss186.htm">
<LINK REL=NEXT HREF="../Issues/iss187_w.htm">
</HEAD>
<BODY>
<H1><A REV=MADE HREF="http://www.lispworks.com/"><IMG WIDTH=80 HEIGHT=65 ALT="[LISPWORKS]" SRC="../Graphics/LWSmall.gif" ALIGN=Bottom></A><A REL=TOP HREF="../Front/index.htm"><IMG WIDTH=237 HEIGHT=65 ALT="[Common Lisp HyperSpec (TM)]" SRC="../Graphics/CLHS_Sm.gif" ALIGN=Bottom></A> <A REL=PREV HREF="../Issues/iss185_w.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Previous]" SRC="../Graphics/Prev.gif" ALIGN=Bottom></A><A REL=UP HREF="../Issues/iss186.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Up]" SRC="../Graphics/Up.gif" ALIGN=Bottom></A><A REL=NEXT HREF="../Issues/iss187_w.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Next]" SRC="../Graphics/Next.gif" ALIGN=Bottom></A></H1>
<HR>
<H2>Issue HASH-TABLE-ACCESS Writeup</H2>
<PRE><B>Status:</B> Passed, as amended, Mar 89 X3J13 (by vote of 17-0)<P>
<P>
<P>
<B>Issue:</B> <A HREF="iss186.htm">HASH-TABLE-ACCESS</A><P>
<B>References:</B> Hash-tables (Chapter 21 of CLtL)<P>
<B>Category:</B> ADDITION<P>
<B>Edit History:</B> 13-Sept-88, version 1 by Walter van Roggen<P>
13-Oct-88, version 2 by Walter van Roggen<P>
05-Apr-89, version 3 by Pitman (changes per x3J13)<P>
<P>
<B>Problem Description:<P>
</B> <P>
There are many characteristics of hash-tables which are specified upon<P>
creation but are not accessible afterwards.<P>
<P>
Proposal: (<A HREF="iss186.htm">HASH-TABLE-ACCESS:X3J13-MAR-89</A>)<P>
<P>
Add the following functions to the language:<P>
<P>
<A REL=DEFINITION HREF="../Body/f_hash_2.htm#hash-table-rehash-size"><B>HASH-TABLE-REHASH-SIZE</B></A> <A REL=DEFINITION HREF="../Body/t_hash_t.htm#hash-table"><B>hash-table</B></A><P>
<P>
Returns the current rehash size of a hash table.<P>
<P>
<A REL=DEFINITION HREF="../Body/f_hash_3.htm#hash-table-rehash-threshold"><B>HASH-TABLE-REHASH-THRESHOLD</B></A> <A REL=DEFINITION HREF="../Body/t_hash_t.htm#hash-table"><B>hash-table</B></A><P>
<P>
Returns the current rehash threshold of a hash table.<P>
<P>
<A REL=DEFINITION HREF="../Body/f_hash_4.htm#hash-table-size"><B>HASH-TABLE-SIZE</B></A> <A REL=DEFINITION HREF="../Body/t_hash_t.htm#hash-table"><B>hash-table</B></A><P>
<P>
Returns the current size of a hash table.<P>
<P>
<A REL=DEFINITION HREF="../Body/f_hash_5.htm#hash-table-test"><B>HASH-TABLE-TEST</B></A> <A REL=DEFINITION HREF="../Body/t_hash_t.htm#hash-table"><B>hash-table</B></A><P>
<P>
Returns the test used for comparing keys in the hash table.<P>
By default the value will be <A REL=DEFINITION HREF="../Body/a_eql.htm#eql"><B>EQL</B></A>.<P>
<P>
Define that the results of <A REL=DEFINITION HREF="../Body/f_hash_2.htm#hash-table-rehash-size"><B>HASH-TABLE-REHASH-SIZE</B></A>, <P>
<A REL=DEFINITION HREF="../Body/f_hash_3.htm#hash-table-rehash-threshold"><B>HASH-TABLE-REHASH-THRESHOLD</B></A>, and <A REL=DEFINITION HREF="../Body/f_hash_4.htm#hash-table-size"><B>HASH-TABLE-SIZE</B></A> are suitable<P>
for use in a call to <A REL=DEFINITION HREF="../Body/f_mk_has.htm#make-hash-table"><B>MAKE-HASH-TABLE</B></A> in order to produce a hash<P>
table with state corresponding to the current state of the hash<P>
table.<P>
<P>
Clarify that the result of <A REL=DEFINITION HREF="../Body/f_hash_5.htm#hash-table-test"><B>HASH-TABLE-TEST</B></A> is always a symbol<P>
naming a function rather than the function itself if the test<P>
is one of those defined by this <A REL=DEFINITION HREF="../Body/07_ffb.htm#standard"><B>standard</B></A>. (Implementations which<P>
<A REL=DEFINITION HREF="../Body/f_provid.htm#provide"><B>provide</B></A> additional tests for hash tables may determine how this<P>
function relates to such extended tests.)<P>
<P>
<B>Current Practice:<P>
</B> <P>
VAX LISP and Lucid 3.0 implement the proposal.<P>
<P>
<B>Cost to Implementors:<P>
</B> <P>
Most of these should be trivial to implement, since the information<P>
must be present for nearly all types.<P>
<P>
<B>Cost to Users:<P>
</B> <P>
None. This is an upward-compatible extension.<P>
<P>
<B>Cost of Non-Adoption:<P>
</B> <P>
The benefits would not be available in a portable fashion.<P>
<P>
<B>Benefits:<P>
</B> <P>
Programs would be able to access useful information otherwise hidden.<P>
For example, it would allow programs to gain statistics about hash<P>
table usage that might enable better tuning.<P>
<P>
<B>Discussion:<P>
</B> <P>
None of these are required to be <A REL=DEFINITION HREF="../Body/a_setf.htm#setf"><B>SETF</B></A>'able, though some might be<P>
reasonable implementation-dependent extensions. Including such<P>
modification abilities might constrain some implementations unduly.<P>
<P>
This first appeared in &quot;&gt;GLS&gt;clarifications.text&quot; of 12/06/85.<P>
</PRE>
<HR>
<A REL=NAVIGATOR HREF="../Front/StartPts.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Starting Points]" SRC="../Graphics/StartPts.gif" ALIGN=Bottom></A><A REL=TOC HREF="../Front/Contents.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Contents]" SRC="../Graphics/Contents.gif" ALIGN=Bottom></A><A REL=INDEX HREF="../Front/X_Master.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Index]" SRC="../Graphics/Index.gif" ALIGN=Bottom></A><A REL=INDEX HREF="../Front/X_Symbol.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Symbols]" SRC="../Graphics/Symbols.gif" ALIGN=Bottom></A><A REL=GLOSSARY HREF="../Body/26_a.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Glossary]" SRC="../Graphics/Glossary.gif" ALIGN=Bottom></A><A HREF="../Front/X3J13Iss.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Issues]" SRC="../Graphics/Issues.gif" ALIGN=Bottom></A><BR>
<A REL=COPYRIGHT HREF="../Front/Help.htm#Legal"><I>Copyright 1996-2005, LispWorks Ltd. All rights reserved.</I></A><P>
</BODY>
</HTML>