From: taylanbayirli@gmail.com (Taylan Ulrich Bayırlı/Kammer)
To: 22447@debbugs.gnu.org
Subject: bug#22447: (rnrs hashtables): Mutation of immutable hashtable ignored
Date: Sun, 24 Jan 2016 00:19:17 +0100 [thread overview]
Message-ID: <87lh7fkhoq.fsf@T420.taylan> (raw)
In-Reply-To: <87zivwj8ne.fsf@T420.taylan>
[-- Attachment #1: Type: text/plain, Size: 147 bytes --]
Sorry about the duplicate bug report; I merged it into this one.
Here's the patch again. (Merged report seemed invisible in the web
interface.)
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Hashtable-set-errors-on-immutable-hashtable.patch --]
[-- Type: text/x-diff, Size: 1112 bytes --]
From dd6c4bbbe85a57fcbb08bdc7847075bddc1f0d87 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Taylan=20Ulrich=20Bay=C4=B1rl=C4=B1/Kammer?=
<taylanbayirli@gmail.com>
Date: Sat, 23 Jan 2016 22:35:24 +0100
Subject: [PATCH] Hashtable-set! errors on immutable hashtable.
* module/rnrs/hashtables.scm (hashtable-set!): Raise an assertion
violation error when the hashtable is immutable.
---
module/rnrs/hashtables.scm | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/module/rnrs/hashtables.scm b/module/rnrs/hashtables.scm
index 98d2d76..5773eb1 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)
--
2.6.3
next prev parent reply other threads:[~2016-01-23 23:19 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-23 21:19 bug#22447: (rnrs hashtables): Mutation of immutable hashtable ignored "Taylan Ulrich Bayırlı/Kammer"
2016-01-23 23:19 ` Taylan Ulrich Bayırlı/Kammer [this message]
2016-01-24 11:44 ` Taylan Ulrich Bayırlı/Kammer
2016-06-20 22:33 ` Taylan Ulrich Bayırlı/Kammer
2016-06-21 7:47 ` Andy Wingo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87lh7fkhoq.fsf@T420.taylan \
--to=taylanbayirli@gmail.com \
--cc=22447@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).