From 4fc3360c666dd7a47a58b988ae243a7d56624e68 Mon Sep 17 00:00:00 2001 From: Nikodemus Siivola Date: Tue, 6 Nov 2007 14:21:50 +0000 Subject: [PATCH] 1.0.11.12: MAPHASH and WITH-HASH-TABLE documentation * paraphrase the hash-table traversal/side-effect rule --- src/code/hash-table.lisp | 15 ++++++++++----- src/code/target-hash-table.lisp | 8 ++++++-- version.lisp-expr | 2 +- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/src/code/hash-table.lisp b/src/code/hash-table.lisp index aeab5f13f..23f7b0f27 100644 --- a/src/code/hash-table.lisp +++ b/src/code/hash-table.lisp @@ -95,11 +95,16 @@ #!+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-"))) diff --git a/src/code/target-hash-table.lisp b/src/code/target-hash-table.lisp index 6b25a6e6b..88bb1ca5c 100644 --- a/src/code/target-hash-table.lisp +++ b/src/code/target-hash-table.lisp @@ -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)) diff --git a/version.lisp-expr b/version.lisp-expr index e0bccc0ff..90a1df0a9 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -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" -- 2.11.4.GIT