Method code for $dictionary.del_elem()

[Turn on line numbering]
arg dict, key, elem;
var value;

value = (| dict[key] |);
if (type(value) != 'list && type(value) != 'error)
    throw(~type, "Value for key " + key + " (" + value + ") is not a list.");
anticipate_assignment();
dict = dict_add(dict, key, 0);
value = setremove(value, elem);
if (!value)
    return dict_del(dict, key);
return dict_add(dict, key, value);

// Created 27-Mar-1995 as a part of ColdCore, see: @help Credit

Tlon