From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Neil Jerram Newsgroups: gmane.lisp.guile.bugs Subject: Re: [bug #22022] hashx-set! and -ref Date: Thu, 17 Jan 2008 23:13:27 +0000 Message-ID: <87d4s0cag8.fsf@ossau.uklinux.net> References: <20080114-224004.sv59778.71865@savannah.gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1200611685 15412 80.91.229.12 (17 Jan 2008 23:14:45 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 17 Jan 2008 23:14:45 +0000 (UTC) To: Gregory Marton , bug-guile@gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Fri Jan 18 00:15:03 2008 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JFdwm-0003rT-T2 for guile-bugs@m.gmane.org; Fri, 18 Jan 2008 00:14:57 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JFdwN-0007gA-SW for guile-bugs@m.gmane.org; Thu, 17 Jan 2008 18:14:31 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JFdvN-00077R-OU for bug-guile@gnu.org; Thu, 17 Jan 2008 18:13:29 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JFdvN-000772-4T for bug-guile@gnu.org; Thu, 17 Jan 2008 18:13:29 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JFdvN-00076w-17 for bug-guile@gnu.org; Thu, 17 Jan 2008 18:13:29 -0500 Original-Received: from mail3.uklinux.net ([80.84.72.33]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JFdvM-0004uK-PX for bug-guile@gnu.org; Thu, 17 Jan 2008 18:13:29 -0500 Original-Received: from arudy (host86-145-183-175.range86-145.btcentralplus.com [86.145.183.175]) by mail3.uklinux.net (Postfix) with ESMTP id 13EB71F6FFF; Thu, 17 Jan 2008 23:13:28 +0000 (GMT) Original-Received: from laruns (unknown [192.168.0.10]) by arudy (Postfix) with ESMTP id 8BC4B3800A; Thu, 17 Jan 2008 23:13:27 +0000 (GMT) In-Reply-To: <20080114-224004.sv59778.71865@savannah.gnu.org> (Gregory Marton's message of "Mon, 14 Jan 2008 22:40:06 +0000") User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Linux 2.4-2.6 X-BeenThere: bug-guile@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:3705 Archived-At: Gregory Marton writes: > As an enhancement request, it would be nice for the common case to be able to > pass a hash-function argument and assoc to make-hash-table or to have a > (make-hashx-table hash assoc [size]), and in either case to remember the hash > function so that resize works correctly. Last email on this topic for tonight...! Note that anyone wanting to implement this "saner" interface can straightforwardly do so in Scheme: (define hash-table-hash-fn (make-object-property)) (define hash-table-assoc-fn (make-object-property)) (define (make-hashx-table hash assoc . args) (let ((t (apply make-hash-table args))) (set! (hash-table-hash-fn t) hash) (set! (hash-table-assoc-fn t) assoc) t)) (define (hashx-table-ref t key) (hashx-ref (hash-table-hash-fn t) (hash-table-assoc-fn t) t key)) etc. Regards, Neil