Method code for $foundation.all_msgs()

[Turn off line numbering]
  1: arg @ms;
  2: var d, out, m, a, ams, av, v, b, at;
  3: 
  4: out = #[];
  5: if (ms)
  6:     ms = ms[1];
  7: else
  8:     ms = msgs || #[];
  9: d = $compiler.compile_cml(">>NO DEFAULT<<");
 10: for a in ([this()] + ancestors()) {
 11:     if (a == definer())
 12:         break;
 13:     catch any {
 14:         ams = a.msgs();
 15:         for m in (a.defined_msgs()) {
 16:             [m, at] = m;
 17:             v = (| ms[m] |);
 18:             av = (| ams[m] |);
 19:             if (v) {
 20:                 if (av)
 21:                     v = dict_union(av, v);
 22:                 else
 23:                     v = dict_union(hash b in (at['branches]) to ([b, d]), v);
 24:             } else if (av) {
 25:                 v = av;
 26:             } else {
 27:                 v = hash b in (at['branches]) to ([b, d]);
 28:             }
 29:             out = dict_add(out, m, v);
 30:         }
 31:     }
 32: }
 33: return out;

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

Tlon