1
0
Fork 0
cl-sites/www.cs.cmu.edu/Groups/AI/html/cltl/clm/node156.html

42 lines
2.1 KiB
HTML
Raw Normal View History

2023-10-25 11:23:21 +02:00
<!DOCTYPE HTML PUBLIC "-//W3O//DTD W3 HTML 2.0//EN">
<!Converted with LaTeX2HTML 0.6.5 (Tue Nov 15 1994) by Nikos Drakos (nikos@cbl.leeds.ac.uk), CBLU, University of Leeds >
<HEAD>
<TITLE>16.2. Primitive Hash Function</TITLE>
</HEAD>
<BODY>
<meta name="description" value=" Primitive Hash Function">
<meta name="keywords" value="clm">
<meta name="resource-type" value="document">
<meta name="distribution" value="global">
<P>
<b>Common Lisp the Language, 2nd Edition</b>
<BR> <HR><A NAME=tex2html3471 HREF="node157.html"><IMG ALIGN=BOTTOM ALT="next" SRC="icons/next_motif.gif"></A> <A NAME=tex2html3469 HREF="node154.html"><IMG ALIGN=BOTTOM ALT="up" SRC="icons/up_motif.gif"></A> <A NAME=tex2html3465 HREF="node155.html"><IMG ALIGN=BOTTOM ALT="previous" SRC="icons/previous_motif.gif"></A> <A NAME=tex2html3473 HREF="node1.html"><IMG ALIGN=BOTTOM ALT="contents" SRC="icons/contents_motif.gif"></A> <A NAME=tex2html3474 HREF="index.html"><IMG ALIGN=BOTTOM ALT="index" SRC="icons/index_motif.gif"></A> <BR>
<B> Next:</B> <A NAME=tex2html3472 HREF="node157.html"> Arrays</A>
<B>Up:</B> <A NAME=tex2html3470 HREF="node154.html"> Hash Tables</A>
<B> Previous:</B> <A NAME=tex2html3466 HREF="node155.html"> Hash Table Functions</A>
<HR> <P>
<H1><A NAME=SECTION002020000000000000000>16.2. Primitive Hash Function</A></H1>
<P>
The function <tt>sxhash</tt> is a convenient tool for the user who needs
to create more complicated hashed data structures than are provided by
<tt>hash-table</tt> objects.
<P>
<BR><b>[Function]</b><BR>
<tt>sxhash <i>object</i></tt><P><tt>sxhash</tt> computes a hash code for an object and returns the hash code as
a non-negative fixnum. A property of <tt>sxhash</tt>
is that <tt>(equal <i>x</i> <i>y</i>)</tt> implies <tt>(= (sxhash <i>x</i>) (sxhash <i>y</i>))</tt>.
<P>
The manner in which the hash code is computed is implementation-dependent
but independent of the particular ``incarnation'' or ``core image.''
Hash values produced
by <tt>sxhash</tt> may be written out to files, for example, and meaningfully
read in again into an instance of the same implementation.
<P>
<P>
<HR>
<P><ADDRESS>
AI.Repository@cs.cmu.edu
</ADDRESS>
</BODY>