While we are at it, I was really disappointed when I saw the hashtables in MzScheme. Sorry, but compared to Java they seem quite unelegant, there are not even iterators (though I guess it would be easy to provide them). Maybe there is no better way to do it without objects, I don't know (I am not so well versed in Scheme yet). I just wonder if there are better "collections" than that for MzScheme, somewhere.
I know it is nitpicking, but ultimately it is about trust, while I am learning: do the implementors of MzScheme have a sense of good style, or not.... Maybe I am just spoiled by having lived in an object oriented world for too long, but it also seems to me that sometimes OO makes sense, simply as a way to structure the code. Also I think it is neat how in Java everything has a "toHashcode" method, so you can store everything in a hashmap - how does it even work in Scheme (haven't studied it very close yet, I admit)?
Functional programmers tend to avoid iterators since they aren't referentially transparent. Instead, operations on collections are expressed with higher-order functions that map or fold some function over each element. If you need a first-class "conventional interface" to sequential data, the preferred structure is the linked list.
Hash tables in functional-style languages often let you specify a hash function. That means the hash function is a property of the collection, rather than the objects in it. If you prefer a more "object-oriented" design, you can use an object system such as tinyclos to define a generic hash function. But Schemers usually like to avoid such complexity.
Looking at the PLT documentation, I see that its hash tables don't let you specify a hash function. That's definitely a shortcoming, though arguably not a serious one in practice. SRFI 69 gets this right.
Thanks for the info! I definitely prefer the map or fold approach, however, the MzScheme has a (give-me-next-element n)-approach, which I didn't like at first sight. I will check out the references you gave (tinyclos etc).
I know it is nitpicking, but ultimately it is about trust, while I am learning: do the implementors of MzScheme have a sense of good style, or not.... Maybe I am just spoiled by having lived in an object oriented world for too long, but it also seems to me that sometimes OO makes sense, simply as a way to structure the code. Also I think it is neat how in Java everything has a "toHashcode" method, so you can store everything in a hashmap - how does it even work in Scheme (haven't studied it very close yet, I admit)?