1.0.11.12: MAPHASH and WITH-HASH-TABLE documentation
authorNikodemus Siivola <nikodemus@random-state.net>
Tue, 6 Nov 2007 14:21:50 +0000 (14:21 +0000)
committerNikodemus Siivola <nikodemus@random-state.net>
Tue, 6 Nov 2007 14:21:50 +0000 (14:21 +0000)
* paraphrase the hash-table traversal/side-effect rule

src/code/hash-table.lisp
src/code/target-hash-table.lisp
version.lisp-expr

index aeab5f1..23f7b0f 100644 (file)
   #!+sb-doc
   "WITH-HASH-TABLE-ITERATOR ((function hash-table) &body body)
 
-Provides a method of manually looping over the elements of a hash-table.
-FUNCTION is bound to a generator-macro that, within the scope of the
-invocation, returns one or three values. The first value tells whether any
-objects remain in the hash table. When the first value is non-NIL, the second
-and third values are the key and the value of the next object."
+Provides a method of manually looping over the elements of a
+hash-table. FUNCTION is bound to a generator-macro that, within the
+scope of the invocation, returns one or three values. The first value
+tells whether any objects remain in the hash table. When the first
+value is non-NIL, the second and third values are the key and the
+value of the next object.
+
+Consequences are undefined if HASH-TABLE is mutated during execution
+of BODY, except for changing or removing elements corresponding to the
+current key."
   ;; This essentially duplicates MAPHASH, so any changes here should
   ;; be reflected there as well.
   (let ((n-function (gensym "WITH-HASH-TABLE-ITERATOR-")))
index 6b25a6e..88bb1ca 100644 (file)
@@ -840,8 +840,12 @@ multiple threads accessing the same hash-table without locking."
 (declaim (inline maphash))
 (defun maphash (function-designator hash-table)
   #!+sb-doc
-  "For each entry in HASH-TABLE, call the designated two-argument function on
-the key and value of the entry. Return NIL."
+  "For each entry in HASH-TABLE, call the designated two-argument
+function on the key and value of the entry. Return NIL.
+
+Consequences are undefined if HASH-TABLE is mutated during the call to
+MAPHASH, except for changing or removing elements corresponding to the
+current key."
   ;; This essentially duplicates WITH-HASH-TABLE-ITERATOR, so
   ;; any changes here should be reflected there as well.
   (let ((fun (%coerce-callable-to-fun function-designator))
index e0bccc0..90a1df0 100644 (file)
@@ -17,4 +17,4 @@
 ;;; checkins which aren't released. (And occasionally for internal
 ;;; versions, especially for internal versions off the main CVS
 ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"1.0.11.11"
+"1.0.11.12"