Method code for $list.match_object2()

[Turn off line numbering]
  1: arg objs, str;
  2: var obj, found;
  3: 
  4: found = [];
  5: for obj in (objs) {
  6:     if (type(obj) == 'frob && !valid(frob_class(obj)))
  7:         (<$thing_frob, frob_value(obj)>).discard();
  8:     else if (obj.match_name(str))
  9:         found += [obj];
 10: }
 11: if (listlen(found) == 1)
 12:     return found[1];
 13: if (listlen(found) > 1)
 14:     throw(~ambig, "ambiguous match", found);
 15: throw(~objnf, "Object not found.");

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

Tlon