* Copying an already immutable hashtable, and requesting an

immutable table returns the same table without copying.
This commit is contained in:
Abdulaziz Ghuloum 2007-11-12 00:52:43 -05:00
parent 007f05989b
commit de369b3497
1 changed files with 6 additions and 2 deletions

View File

@ -393,11 +393,15 @@
(case-lambda
[(h)
(if (hasht? h)
(hasht-copy h #f)
(if (hasht-mutable? h)
(hasht-copy h #f)
h)
(error 'hashtable-copy "not a hash table" h))]
[(h mutable?)
(if (hasht? h)
(hasht-copy h (and mutable? #t))
(if (or mutable? (hasht-mutable? h))
(hasht-copy h (and mutable? #t))
h)
(error 'hashtable-copy "not a hash table" h))]))
)