From: Roland Orre <orre@nada.kth.se>
Cc: guile-user@gnu.org, m.vollmer@ping.de, guile-devel@gnu.org
Subject: Re: About hash-table iterators
Date: Tue, 27 Jan 2004 18:39:21 +0100 [thread overview]
Message-ID: <1075225161.23541.1132.camel@localhost> (raw)
In-Reply-To: <xy7vfmxnzmu.fsf@chunk.mit.edu>
On Tue, 2004-01-27 at 17:07, Mikael Djurfeldt wrote:
> [Cross-posting to guile-devel]
>
> Roland Orre <orre@nada.kth.se> 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
<snip>
> 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
next prev parent reply other threads:[~2004-01-27 17:39 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-01-24 13:19 About hash-table iterators Roland Orre
2004-01-27 16:07 ` Mikael Djurfeldt
2004-01-27 17:39 ` Roland Orre [this message]
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=1075225161.23541.1132.camel@localhost \
--to=orre@nada.kth.se \
--cc=guile-devel@gnu.org \
--cc=guile-user@gnu.org \
--cc=m.vollmer@ping.de \
/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).