Method code for $group.parse_grouplist()

[Turn off line numbering]
  1: arg value, method, @args;
  2: var action, list, item, out;
  3: 
  4: if (value && value[1] in ["+", "-"]) {
  5:     if (value[1] == "-")
  6:         action = 'del;
  7:     else
  8:         action = 'add;
  9:     list = [substr(value, 2)];
 10: } else {
 11:     action = 'set;
 12:     list = value.explode_english_list();
 13: }
 14: out = #[];
 15: for item in (list) {
 16:     if (method) {
 17:         catch ~methodnf
 18:             item = (> sender().(method)(item, action, @args) <);
 19:         with
 20:             item = (> .(method)(item, action, @args) <);
 21:     }
 22:     out = dict_add(out, item, 1);
 23: }
 24: if (action == 'set)
 25:     return [action, out];
 26: else
 27:     return [action, out[1]];

// Created 01-Sep-1998 as a part of ColdCore, see: @help Credit

Tlon