From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Roland Orre Newsgroups: gmane.lisp.guile.devel,gmane.lisp.guile.user Subject: Re: About hash-table iterators Date: Tue, 27 Jan 2004 18:39:21 +0100 Organization: Royal Institute of Technology Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Message-ID: <1075225161.23541.1132.camel@localhost> References: <1074950358.23546.902.camel@localhost> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1075226131 22661 80.91.224.253 (27 Jan 2004 17:55:31 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 27 Jan 2004 17:55:31 +0000 (UTC) Cc: guile-user@gnu.org, m.vollmer@ping.de, guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Tue Jan 27 18:55:15 2004 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AlXQg-0000fZ-00 for ; Tue, 27 Jan 2004 18:55:15 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AlXP8-0001Wv-RG for guile-devel@m.gmane.org; Tue, 27 Jan 2004 12:53:38 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1AlXNH-00018I-MB for guile-devel@gnu.org; Tue, 27 Jan 2004 12:51:43 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1AlXM5-0000s1-6w for guile-devel@gnu.org; Tue, 27 Jan 2004 12:51:00 -0500 Original-Received: from [130.237.222.202] (helo=smtp.nada.kth.se) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.24) id 1AlXGY-0007Rz-MG; Tue, 27 Jan 2004 12:44:46 -0500 Original-Received: from bari.bacon.su.se (bari.bacon.su.se [130.237.152.231]) (authenticated bits=0) by smtp.nada.kth.se (8.12.10/8.12.1) with ESMTP id i0RHiiRQ011616 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO); Tue, 27 Jan 2004 18:44:45 +0100 (MET) Original-To: Mikael Djurfeldt In-Reply-To: X-Mailer: Ximian Evolution 1.4.5 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Developers list for Guile, the GNU extensibility library List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.devel:3324 gmane.lisp.guile.user:2731 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.user:2731 On Tue, 2004-01-27 at 17:07, Mikael Djurfeldt wrote: > [Cross-posting to guile-devel] > > Roland Orre writes: > > > The elements of a hash table I consider the handles, not the key and > > the value as separate entities, therefore I don't consider the current > > iterators hash-map and hash-for-each in guile 1.7 very useful and the > > basic iterators I've used over the year, i.e iterating over the handles, > > can not be constructed from them. To be able to implement my previous > > functionality I had to copy and modify a few routines from hashtab.c to > > be able to implement e.g > The design decision for hash-for-each and hash-map was to abstract > away the handle's, which are lower-level details of the representation > of the table, and, also, to promote a functional style of programming. Yes, this is a good argument, although I like functional programming style I'm far away from any purist here. Often I like the imperative style of doing things because it's often more intuitive (at least for me...). Although in the case with hash tables I consider the handle keeping the value together as fundamental and is often using it this way. > However, we *do* support handles in another set of functions. > (Unfortunately, the abstraction is not complete here. If we pass out > a handle object, we should have accessor and mutator functions for > this object and not just presume that it is a pair!) Yes you are right. This may save a lot of work in the long run... > So, I'm inclined to support your idea of introducing > hash-for-each-handle. I'm very pleased by this (the less code to maintain in user space, the better) > I don't think we need to introduce hash-map-handles, though. No, you are right, that is not necessary. Best regards Roland _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel