From: Roland Orre <orre@nada.kth.se>
Subject: About hash-table iterators
Date: Sat, 24 Jan 2004 14:19:18 +0100 [thread overview]
Message-ID: <1074950358.23546.902.camel@localhost> (raw)
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
next reply other threads:[~2004-01-24 13:19 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-01-24 13:19 Roland Orre [this message]
2004-01-27 16:07 ` About hash-table iterators Mikael Djurfeldt
2004-01-27 17:39 ` Roland Orre
2004-02-13 23:22 ` Mikael Djurfeldt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1074950358.23546.902.camel@localhost \
--to=orre@nada.kth.se \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).