[racket-dev] hash->list stability?

From: Carl Eastlund (cce at ccs.neu.edu)
Date: Tue Jun 18 15:29:49 EDT 2013

On Tue, Jun 18, 2013 at 3:21 PM, Dan Liebgold <dan.liebgold at gmail.com>wrote:

> According to the docs, hash->list returns a list in an unspecified order.
>  Can anyone tell me a little about how hash->list might return two
> different orders give the same hash table? Possibly across different
> invocations of Racket?
>
> Thanks,
> --
> Dan Liebgold    [dan.liebgold at gmail.com]
>

Different invocations of Racket could do it; for instance, eq-hash-code
assigns hash codes sequentially to objects on demand, so if objects were
hashed in a different order nondeterministically, they would be put in a
table in a different order.  Adding or removing elements via mutation might
also cause a table to be resized, and that might shuffle around the
existing/remaining elements and cause them to be in a different order.

--Carl
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/dev/archive/attachments/20130618/f0333518/attachment.html>

Posted on the dev mailing list.