[racket] ordering for hash tables?

From: Robby Findler (robby at eecs.northwestern.edu)
Date: Sat Feb 21 08:41:02 EST 2015

I think the current implementation might guarantee the same order for
the same hash table in a single run of racket, but you shouldn't reply
on even that and the current implementation does not make that
guarantee if you run the same program multiple times in racket. (And
the precise details of what the current implementation guarantees
depend on which kind of hash table you have and possibly the timing of
gc and other mysterious things.)


On Sat, Feb 21, 2015 at 7:03 AM, Alexander D. Knauth
<alexander at knauth.org> wrote:
> If I have two hash tables, both with the same set of keys, but with
> different values for those keys, then can I count on the order being the
> same for both hash-tables?
> I noticed this:
> https://github.com/plt/racket/commit/abe1233734b3a8d46f96707cc3a2517340cb28a3
> saying:
> make hash-table order invertible at build time
> For detecting and debugging accidental dependencies on hash-table
> order, it might be helpful to invert the order at the lowest level.
> Does this mean I shouldn’t count on the order being the same?  How does this
> work?
> ____________________
>   Racket Users list:
>   http://lists.racket-lang.org/users

Posted on the users mailing list.