From 037967fd58dc1e7efe3f1635e2df387a836022b8 Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Sun, 15 Jun 2014 01:46:31 +0900 Subject: [PATCH] dictionary-delete raises an error when no binding with given name is registered --- src/dict.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/dict.c b/src/dict.c index 7ad254ec..ddbe2cb5 100644 --- a/src/dict.c +++ b/src/dict.c @@ -67,6 +67,10 @@ pic_dict_dict_del(pic_state *pic) pic_get_args(pic, "dm", &dict, &key); + if (xh_get_int(&dict->hash, key) == NULL) { + pic_errorf(pic, "no slot named ~s found in dictionary", pic_sym_value(key)); + } + xh_del_int(&dict->hash, key); return pic_none_value();