[racket-dev] hash->list stability?

From: Dan Liebgold (dan.liebgold at gmail.com)
Date: Tue Jun 18 15:59:58 EDT 2013

That makes sense.  'sort' to the rescue!

On Tuesday, June 18, 2013, Carl Eastlund wrote:

> On Tue, Jun 18, 2013 at 3:21 PM, Dan Liebgold <dan.liebgold at gmail.com<javascript:_e({}, 'cvml', '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 <javascript:_e({}, 'cvml',
>> '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
>


-- 
Dan Liebgold    [dan.liebgold at gmail.com]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/dev/archive/attachments/20130618/8ab3e38e/attachment.html>

Posted on the dev mailing list.