[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: About hash-table iterators

From: Mikael Djurfeldt
Subject: Re: About hash-table iterators
Date: Fri, 13 Feb 2004 18:22:06 -0500
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux)

Mikael Djurfeldt <address@hidden> writes:

> 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.
> The decision is supported by the same choice made for Common Lisps's
> `maphash' (although Common Lisp has setf so that the side-effects (the
> *only* effects, btw) also include mutating the table).  Also, java
> does not use the concept of handles either.

BTW, since then I've looked around, and virtually every Scheme
implementation I find have made the same choice as we have.

> 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!)
> So, I'm inclined to support your idea of introducing
> hash-for-each-handle.

Since I didn't get any feedback I went ahead and checked this into CVS

2004-02-13  Mikael Djurfeldt  <address@hidden>

        (scm_internal_hash_for_each_handle, scm_hash_for_each_handle): New

> I don't think we need to introduce hash-map-handles, though.
> Also: Is it the case that hash-map has a really bad name?  It strikes
> me that one would expect hash-map to return another hash table.
> Should it instead be named hash-map-to-list or something better?

2004-02-13  Mikael Djurfeldt  <address@hidden>

        * hashtab.c, hashtab.h (scm_hash_map_to_list): Renamed from

2004-02-12  Mikael Djurfeldt  <address@hidden>

        * boot-9.scm (module-map): Renamed hash-map -> hash-map->list.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]