[r6rs-discuss] [Formal] proc in hash-table-update! should not mutate hash-table

From: Daniel Villeneuve <daniel_villeneuve>
Date: Thu Feb 22 01:04:15 2007

---
This message is a formal comment which was submitted to formal-comment_at_r6rs.org, following the requirements described at: http://www.r6rs.org/process.html
---
submitter's name: Daniel Villeneuve
submitter's email address: daniel_villeneuve_at_sympatico.ca
type of issue: Enhancement
priority: Minor
R6RS component: Hash Tables
version of the report: 5.92
SUMMARY
The callback procedure of the hash-table-update! function should be
restricted to not mutate the hash-table being updated.
DESCRIPTION
The advertised goal of hash-table-update! is to allow an implementation to
provide a more efficient update algorithm than the one proposed in the
Standard.
Such extra efficiency is presumed to come from the implementation
remembering the "entry" found by the underlying call to hash-table-ref and
reusing this entry in the underlying call to hash-table-set!.
But this remembering seems unsound if <proc> can call (hash-table-delete! 
ht key) or (hash-table-clear! ht).
PROPOSAL
Add "<proc> must not mutate the hash-table" as in the specification of map.
--
Daniel Villeneuve
Received on Tue Feb 20 2007 - 20:16:13 UTC

This archive was generated by hypermail 2.3.0 : Wed Oct 23 2024 - 09:15:01 UTC