[Turn off line numbering]1: arg dict, key, elem; 2: var value; 3: 4: value = (| dict[key] |); 5: if (type(value) != 'list && type(value) != 'error) 6: throw(~type, "Value for key " + key + " (" + value + ") is not a list."); 7: anticipate_assignment(); 8: if (value) { 9: dict = dict_add(dict, key, 0); 10: value = setadd(value, elem); 11: } else { 12: value = [elem]; 13: } 14: return dict_add(dict, key, value);
// Created 27-Mar-1995 as a part of ColdCore, see: @help Credit