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

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

Re: [MIT-Scheme-devel] hash-table/modify!


From: Taylor R Campbell
Subject: Re: [MIT-Scheme-devel] hash-table/modify!
Date: Sun, 20 Dec 2009 03:39:41 -0500
User-agent: IMAIL/1.21; Edwin/3.116; MIT-Scheme/7.7.90.+

   Date: Sun, 20 Dec 2009 03:34:53 -0500
   From: Taylor R Campbell <address@hidden>

      Date: Sun, 20 Dec 2009 00:30:22 -0800
      From: Joe Marshall <address@hidden>

      What would happen if the modifier procedure added or deleted an element
      from the table?  I'm thinking about the case where we've found the cell
      pointing at the entry, but the modifier code causes a rehash and the
      bucket links are rethreaded while we're trying to walk them.

   That's a screw case that blocking interrupts doesn't change.  The
   modifier procedure is not supposed to update the table.

It occurs to me, though, that while HASH-TABLE/MODIFY! is not
documented, HASH-TABLE-UPDATE! is, and as a consequence of what I said
above, our implementation of it does not conform to the specification
of HASH-TABLE-UPDATE! in SRFI 69, which does not prohibit editing the
hash table in <procedure> and says that

(HASH-TABLE-UPDATE! <hash-table> <key> <procedure> <default>)

is semantically equivalent to

(HASH-TABLE-SET!
 <hash-table>
 <key>
 (<procedure> (HASH-TABLE-REF <hash-table> <key> <default>))),

modulo duplicate evaluation of arguments.  So maybe we need to change
our definition of HASH-TABLE-UPDATE!, too.




reply via email to

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