~ chicken-core (chicken-5) c9ec6c3e3f99428d5136b63fd703c295a32b00aa
commit c9ec6c3e3f99428d5136b63fd703c295a32b00aa Author: felix <felix@call-with-current-continuation.org> AuthorDate: Fri Sep 17 22:59:59 2010 +0200 Commit: felix <felix@call-with-current-continuation.org> CommitDate: Fri Sep 17 22:59:59 2010 +0200 3rd arg to hash-table-update\! is optional diff --git a/manual/Unit srfi-69 b/manual/Unit srfi-69 index a584af57..80fc3fef 100644 --- a/manual/Unit srfi-69 +++ b/manual/Unit srfi-69 @@ -172,12 +172,12 @@ is equivalent to ==== hash-table-update! -<procedure>(hash-table-update! HASH-TABLE KEY [UPDATE-FUNCTION [DEFAULT-VALUE-FUNCTION]])</procedure> +<procedure>(hash-table-update! HASH-TABLE KEY UPDATE-FUNCTION [DEFAULT-VALUE-FUNCTION])</procedure> Sets or replaces the {{VALUE}} for {{KEY}} in the {{HASH-TABLE}}. The {{UPDATE-FUNCTION}} takes the existing {{VALUE}} for {{KEY}} and returns -the new {{VALUE}}. The default is {{identity}} +the new {{VALUE}}. The {{DEFAULT-VALUE-FUNCTION}} is called when the entry for {{KEY}} is missing. The default uses the {{(hash-table-initial-value)}}, if provided. Otherwise diff --git a/srfi-69.scm b/srfi-69.scm index a46acb0a..6958e3d8 100644 --- a/srfi-69.scm +++ b/srfi-69.scm @@ -655,14 +655,16 @@ (define hash-table-update! (let ([core-eq? eq?] ) (lambda (ht key - #!optional (func (lambda (x) x)) - (thunk - (let ([thunk (##sys#slot ht 9)]) - (or thunk - (lambda () - (##sys#signal-hook #:access-error - 'hash-table-update! - "hash-table does not contain key" key ht)))))) + (func (lambda (x) x)) + #!optional + (thunk + (let ([thunk (##sys#slot ht 9)]) + (or thunk + (lambda () + (##sys#signal-hook + #:access-error + 'hash-table-update! + "hash-table does not contain key" key ht)))))) (##sys#check-structure ht 'hash-table 'hash-table-update!) (##sys#check-closure func 'hash-table-update!) (##sys#check-closure thunk 'hash-table-update!)Trap