From xemacs-m  Wed Mar 26 16:21:13 1997
Received: from newman (root@newman.aventail.com [38.225.141.10])
	by xemacs.org (8.8.5/8.8.5) with SMTP id QAA05615
	for <xemacs-beta@xemacs.org>; Wed, 26 Mar 1997 16:21:10 -0600 (CST)
Received: from kramer.in.aventail.com.aventail.com (wmperry@kramer [192.168.1.12]) by newman (8.6.12/8.6.9) with SMTP id OAA20254; Wed, 26 Mar 1997 14:18:27 -0800
Date: Wed, 26 Mar 1997 14:18:27 -0800
Message-Id: <199703262218.OAA20254@newman>
From: "William M. Perry" <wmperry@aventail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
To: "Karl M. Hegbloom" <karlheg@inetarena.com>
Cc: <xemacs-beta@xemacs.org>
Subject: Re: puthash,gethash question
In-Reply-To: <199703262216.OAA10121@bittersweet.inetarena.com>
References: <199703262216.OAA10121@bittersweet.inetarena.com>
X-Mailer: VM 6.22 under 19.15 XEmacs Lucid
Errors-to: wmperry@aventail.com
Reply-to: wmperry@aventail.com
X-Face: O~Rn;(l][/-o1sALg4A@xpE:9-"'IR[%;,,!m7</SYF`{vYQ(&RI1&EiH[FvT;J}@f!4kfz
 x_!Y#=y{Uuj9GvUi=cPuajQ(Z42R[wE@{G,sn$qGr5g/wnb*"*ktI+,CD}1Z'wxrM2ag-r0p5I6\nA
 [WJopW_J.WY;

Karl M. Hegbloom writes:
>
> I've started reading the lispref, was just trying out hashtables, and
>cannot figure out why gethash does not return a value here.  Would
>someone please help?
>
>(setq h (make-hashtable 16384))
>==>#<hashtable 0/25229 0x3ec1>
[...]

  By default, hashtables use 'eq' to compare things.  This makes it useless
for strings.  You should do:

(setq h (make-hashtable 16384 'equal))
==>#<hashtable 0/25229 0x2594>

(hashtable-fullness h)
==>0

(puthash "karlheg" "Karl M. Hegbloom" h)
==>"Karl M. Hegbloom"

(gethash "karlheg" h)
==>"Karl M. Hegbloom"

(hashtable-fullness h)
==>1

-Bill P.

