[r6rs-discuss] [Formal] hash-table-mutable? vs hash-table-immutable?

From: Daniel Villeneuve <daniel_villeneuve>
Date: Thu Feb 22 01:42:42 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 (very)
R6RS component: Hash Tables
version of the report: 5.92
SUMMARY
The predicate about mutability of hash-tables would be better defined as
hash-table-immutable?.
DESCRIPTION
I suggest that the predicate to test about mutability/immutability of
hash-tables be named hash-table-immutable? for the following reasons:
a) This is the property that is given to hash-table-copy.
b) Among all Scheme collections, immutability is the exception, and this is
   what we want to single out.
c) I think that the most frequent idiom for this predicate is
(define (some-function-modifying-a-hash-table! ht)
  (if (not (hash-table-mutable? ht))
     (error ...)))
which can be written a little more succinctly as
(define (some-function-modifying-a-hash-table! ht)
  (if (hash-table-immutable? ht)
     (error ...)))
PROPOSAL
Replace hash-table-mutable? by hash-table-immutable?.
--
Daniel Villeneuve
Received on Tue Feb 20 2007 - 20:35:50 UTC

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