summaryrefslogtreecommitdiff
path: root/module/rnrs
diff options
context:
space:
mode:
authorTaylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>2016-06-21 00:33:50 +0200
committerAndy Wingo <wingo@pobox.com>2016-06-21 09:47:07 +0200
commitc1abe68dbc8580f677388e762760348ea24cbd89 (patch)
treecf1af1ccda747ed28d76e197fe916aed6baa4ce9 /module/rnrs
parentbeea6302e06e7e41b1b835b2327febc97177010e (diff)
downloadguile-c1abe68dbc8580f677388e762760348ea24cbd89.tar.gz
(rnrs hashtables): Mutation of immutable hashtable ignored
Pinging this thread with a (very slightly) updated patch. :-) [2. text/x-diff; 0001-Hashtable-set-errors-on-immutable-hashtable.patch] From 7f35d515d711e255bba5a89a013d9d92034edf41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Taylan=20Ulrich=20Bay=C4=B1rl=C4=B1/Kammer?= <taylanbayirli@gmail.com> Date: Tue, 21 Jun 2016 00:25:19 +0200 Subject: [PATCH] Hashtable-set! errors on immutable hashtable. * module/rnrs/hashtables.scm (hashtable-set!): Raise an assertion violation error when the hashtable is immutable. * test-suite/tests/r6rs-hashtables.test: Fix accordingly.
Diffstat (limited to 'module/rnrs')
-rw-r--r--module/rnrs/hashtables.scm5
1 files changed, 3 insertions, 2 deletions
diff --git a/module/rnrs/hashtables.scm b/module/rnrs/hashtables.scm
index 98d2d7616..5773eb1a8 100644
--- a/module/rnrs/hashtables.scm
+++ b/module/rnrs/hashtables.scm
@@ -122,8 +122,9 @@
(define (hashtable-set! hashtable key obj)
(if (r6rs:hashtable-mutable? hashtable)
- (hash-table-set! (r6rs:hashtable-wrapped-table hashtable) key obj))
- *unspecified*)
+ (hash-table-set! (r6rs:hashtable-wrapped-table hashtable) key obj)
+ (assertion-violation
+ 'hashtable-set! "Hashtable is immutable." hashtable)))
(define (hashtable-delete! hashtable key)
(if (r6rs:hashtable-mutable? hashtable)