From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Noah Lavine Newsgroups: gmane.lisp.guile.devel Subject: Re: rfi: hash set Date: Wed, 19 Jan 2011 21:11:07 -0500 Message-ID: References: <87r5cbi5l7.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1295489507 32594 80.91.229.12 (20 Jan 2011 02:11:47 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 20 Jan 2011 02:11:47 +0000 (UTC) Cc: guile-devel@gnu.org To: =?ISO-8859-1?Q?Ludovic_Court=E8s?= Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Thu Jan 20 03:11:43 2011 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Pfjzx-0004iu-RK for guile-devel@m.gmane.org; Thu, 20 Jan 2011 03:11:42 +0100 Original-Received: from localhost ([127.0.0.1]:34444 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pfjzx-0001ac-Af for guile-devel@m.gmane.org; Wed, 19 Jan 2011 21:11:41 -0500 Original-Received: from [140.186.70.92] (port=48207 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PfjzW-0001Mf-EU for guile-devel@gnu.org; Wed, 19 Jan 2011 21:11:15 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PfjzR-0000j6-Lb for guile-devel@gnu.org; Wed, 19 Jan 2011 21:11:14 -0500 Original-Received: from mail-wy0-f169.google.com ([74.125.82.169]:64505) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PfjzR-0000j1-FA; Wed, 19 Jan 2011 21:11:09 -0500 Original-Received: by wyj26 with SMTP id 26so177072wyj.0 for ; Wed, 19 Jan 2011 18:11:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=omDreMyKuCQ8ue99QJT2ALI7pLhtgX+uH0QPpLabW/Y=; b=fej4Ys6Fra8cNTy4j9Z86FW+cNbVbHSwqgqNd+WkujHkL67WHCj0vefH6XON9ZU9uP 7HzWTXfdy+uktNCLKxzbGPVpNmS/PgjjIdZhOLhoRwF/CR42iSk7Gti/84/I2FnHUpHj yvJ48G2tisYuTozN+h7T/ZPBgEZJghgtFopt0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=eZf109zROnffC7806/WRYBTjKklE8I0xd2Bdi1IXt51wUor7SJyNalBxx4DzNaFHNx b5oBWnRxUIsp2t8NAt9Xco5ltSlpCjw/LT8/MOUVNF8fh5pklrWW6iAeKnJj2ncVnAvN 4h238hzaXfHmDRiPxznxW0qRMWZ1jeTAO4OrM= Original-Received: by 10.216.163.11 with SMTP id z11mr1365536wek.36.1295489467986; Wed, 19 Jan 2011 18:11:07 -0800 (PST) Original-Received: by 10.216.156.65 with HTTP; Wed, 19 Jan 2011 18:11:07 -0800 (PST) In-Reply-To: <87r5cbi5l7.fsf@gnu.org> X-Google-Sender-Auth: OF7uKDRUqb5GxnWExwRCn4vB3bE X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:11319 Archived-At: Hello again, Actually, I need to retract what I said before. Here is what I think is actually going on, and it means that the current code is correct. min_size_index will usually be 0, which means the table can shrink down to the minimum hash table size (31). The only case it won't be 0 is if the hash table was created by passing a size argument to make-hash-table, in which case min_size_index will be whatever it needs to be so that the table will never shrink below the size specified to make-hash-table. This is consistent with the documentation, which says that a table created with a given size will always be at least that large. Sorry about that. I'll work on hash sets now. Noah On Mon, Jan 17, 2011 at 4:27 PM, Ludovic Court=E8s wrote: > Hi Noah! > > Noah Lavine writes: > >> I started looking into implementing this, and I ran into something >> strange that I'd like clarification on. Am I correct in saying that >> currently, hash tables can only shrink by one size index when they are >> rehashed? > > Yes, your analysis looks correct to me. =A0Would you like to look into > fixing this? =A0:-) > > I suppose the trick would be to regularly recompile =91min_size_index=92 > based on the current =91SCM_HASHTABLE_N_ITEMS=92, iterating on > HASHTABLE_SIZE, starting from the current =91min_size_index=92. > > Thanks, > Ludo=92. > > >