dictionary-delete raises an error when no binding with given name is registered
This commit is contained in:
		
							parent
							
								
									a8a56aa34e
								
							
						
					
					
						commit
						037967fd58
					
				|  | @ -67,6 +67,10 @@ pic_dict_dict_del(pic_state *pic) | ||||||
| 
 | 
 | ||||||
|   pic_get_args(pic, "dm", &dict, &key); |   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); |   xh_del_int(&dict->hash, key); | ||||||
| 
 | 
 | ||||||
|   return pic_none_value(); |   return pic_none_value(); | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	 Yuichi Nishiwaki
						Yuichi Nishiwaki