mit-scheme-devel
[Top][All Lists]
Advanced

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

Re: [MIT-Scheme-devel] [commit 9ddb22a] Fix nasty bug: modifying a hash


From: Taylor R Campbell
Subject: Re: [MIT-Scheme-devel] [commit 9ddb22a] Fix nasty bug: modifying a hash table could scramble its buckets.
Date: Fri, 17 Mar 2017 06:50:51 +0000

> Date: Tue Feb 7 20:23:41 2017 -0800
> From: Chris Hanson <org/chris-hanson/cph>
>
> Fix nasty bug: modifying a hash table could scramble its buckets.

This was intentional -- as the documentation notes, the procedure
passed to HASH-TABLE/MODIFY! is not allowed to use the hash table.
In contrast, SRFI 69 HASH-TABLE-UPDATE! does allow the procedure you
pass to use the table arbitrarily.

Note that even with your change, you can still screw yourself by,
e.g., removing the entry and re-entering it inside the procedure.  See
test-hash-table.scm for several screw cases that HASH-TABLE-UPDATE!
goes to the extra effort to avoid.



reply via email to

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