From xemacs-m  Wed Mar 26 16:42:05 1997
Received: from bittersweet.inetarena.com (karlheg@bittersweet.inetarena.com [206.129.216.38])
	by xemacs.org (8.8.5/8.8.5) with ESMTP id QAA05743
	for <xemacs-beta@xemacs.org>; Wed, 26 Mar 1997 16:42:04 -0600 (CST)
Received: (from karlheg@localhost)
	by bittersweet.inetarena.com (8.8.5/8.8.5) id OAA10227;
	Wed, 26 Mar 1997 14:41:49 -0800
Date: Wed, 26 Mar 1997 14:41:49 -0800
Message-Id: <199703262241.OAA10227@bittersweet.inetarena.com>
From: "Karl M. Hegbloom" <karlheg@inetarena.com>
To: wmperry@aventail.com, <xemacs-beta@xemacs.org>
Subject: Re: puthash,gethash question
In-Reply-To: <199703262218.OAA20254@newman>
References: <199703262216.OAA10121@bittersweet.inetarena.com>
	<199703262218.OAA20254@newman>
X-Mailer: VM 6.22 under 19.15 XEmacs Lucid (beta104)
Comments: Hyperbole mail buttons accepted, v04.023.
Mime-Version: 1.0 (generated by tm-edit 7.106)
Content-Type: multipart/mixed;
 boundary="Multipart_Wed_Mar_26_14:41:48_1997-1"
Content-Transfer-Encoding: 7bit

--Multipart_Wed_Mar_26_14:41:48_1997-1
Content-Type: text/plain; charset=US-ASCII

>>>>> "William" == William M Perry <wmperry@aventail.com> writes:

    William> 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>
    William> [...]

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

    William> (setq h (make-hashtable 16384 'equal))

 That makes sense.  The original string doesn't really exist anywhere
but where I typed it, since it's a literal.  I just tried with
variables, and it works the way I expect, since the actual string is
tucked away someplace where the hashtable can refer to it without
having to make a copy for itself.

 For literals, using 'equal works, since it matches a copy of the
string, not the string itself; or the location in storage that is the
string.


--Multipart_Wed_Mar_26_14:41:48_1997-1
Content-Type: text/plain; charset=US-ASCII

Karl M. Hegbloom <karlheg@inetarena.com>
http://www.inetarena.com/~karlheg
Portland, OR  USA
Debian GNU 1.2  Linux 2.0.29t
You tell me and we'll both know.


--Multipart_Wed_Mar_26_14:41:48_1997-1--

