// now also takes a map as single array entry static A mapMethodLike optParOr(S name, O[] opt, IF0 defaultFunction) { int n = l(opt); if (n == 1 && opt[0] instanceof Map) { Map map = cast opt[0]; ret (A) (map.containsKey(name) ? map.get(name) : callF(defaultFunction)); } if (!even(l(opt))) fail("Odd parameter length"); for (int i = 0; i < l(opt); i += 2) if (eq(opt[i], name)) ret (A) opt[i+1]; ret (A) callF(defaultFunction); }