(error:bad-range-argument key 'HASH-TABLE-UPDATE!))
get-default)))))
+(define (hash-table-update!/default table key procedure default)
+ (hash-table-update! table key procedure (lambda () default)))
+
(define (hash-table-copy table)
(guarantee-hash-table table 'HASH-TABLE-COPY)
(with-table-locked! table
(hash-table-ref/default hash-table/get)
(hash-table-set! hash-table/put!)
(hash-table-size hash-table/count)
- (hash-table-update!/default hash-table/modify!)
(hash-table-values hash-table/datum-list)
(hash-table-walk hash-table/for-each)
(make-eq-hash-table make-key-weak-eq-hash-table)
hash-table-ref
hash-table-type?
hash-table-update!
+ hash-table-update!/default
hash-table/clean!
hash-table/clear!
hash-table/constructor
'WIN))
(assert-eqv (hash-table/get hash-table 0 'LOSE-2) 'WIN))))
+(define-test 'REGRESSION:MODIFICATION-DURING-SRFI-69-UPDATE/DEFAULT:0
+ (lambda ()
+ (let ((hash-table
+ ((strong-hash-table/constructor (lambda (k m) k m 0) eqv?))))
+ (hash-table/put! hash-table 0 'LOSE-0)
+ (hash-table-update!/default hash-table 0
+ (lambda (datum)
+ datum ;ignore
+ ;; Force consing a new entry.
+ (hash-table/remove! hash-table 0)
+ (hash-table/put! hash-table 0 'LOSE-1)
+ 'WIN)
+ 'LOSE-2)
+ (assert-eqv (hash-table/get hash-table 0 'LOSE-3) 'WIN))))
+
+(define-test 'REGRESSION:MODIFICATION-DURING-SRFI-69-UPDATE/DEFAULT:1
+ (lambda ()
+ (let ((hash-table
+ ((strong-hash-table/constructor (lambda (k m) k m 0) eqv?))))
+ (hash-table-update!/default hash-table 0
+ (lambda (datum)
+ datum ;ignore
+ (hash-table/put! hash-table 1 'WIN-1)
+ 'WIN-0)
+ 'LOSE-0A)
+ (assert-eqv (hash-table/get hash-table 0 'LOSE-0B) 'WIN-0)
+ (assert-eqv (hash-table/get hash-table 1 'LOSE-1) 'WIN-1))))
+
(define-test 'REGRESSION:MODIFICATION-DURING-SRFI-69-FOLD
(lambda ()
(let* ((index 1)