From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Roland Orre Newsgroups: gmane.lisp.guile.user Subject: About hash-table iterators Date: Sat, 24 Jan 2004 14:19:18 +0100 Organization: Royal Institute of Technology Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Message-ID: <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 1074950907 6501 80.91.224.253 (24 Jan 2004 13:28:27 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 24 Jan 2004 13:28:27 +0000 (UTC) Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Sat Jan 24 14:28:20 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 1AkNpj-0003EX-01 for ; Sat, 24 Jan 2004 14:28:20 +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 1AkNoD-0004PY-Tk for guile-user@m.gmane.org; Sat, 24 Jan 2004 08:26:45 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1AkNmZ-00045n-63 for guile-user@gnu.org; Sat, 24 Jan 2004 08:25:03 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1AkNlz-0003dV-KZ for guile-user@gnu.org; Sat, 24 Jan 2004 08:24:59 -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 1AkNly-0003cJ-VM for guile-user@gnu.org; Sat, 24 Jan 2004 08:24:27 -0500 Original-Received: from c640 (h148n2fls33o875.telia.com [217.208.54.148]) (authenticated bits=0) by smtp.nada.kth.se (8.12.10/8.12.1) with ESMTP id i0ODONRQ028006 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO); Sat, 24 Jan 2004 14:24:24 +0100 (MET) Original-To: guile-user@gnu.org X-Mailer: Ximian Evolution 1.4.5 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.user:2709 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.user:2709 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 hash-for-each-handle hash-map-handles and from the latter can then e.g hash-table->list be implemented (define-public (hash-table->list htable) (hash-map-handles id htable)) and when you don't want to be able to modify the original table you can use hash-map instead: (define-public (hash-table-copy->list htable) (hash-map cons htable)) Is this a general interest? In that case these maybe they should be considered the basic iterators provided instead of hash-for-each and hash-map as the latter can be implemented from the other but not vice versa? Best regards Roland _______________________________________________ Guile-user mailing list Guile-user@gnu.org http://mail.gnu.org/mailman/listinfo/guile-user