static S exposeMethods(S s, L methodNames) { ret exposeMethods(s, toStringArray(methodNames)); // TODO: optimize } static S exposeMethods(S s, S... methodNames) { new Matches m; if "call *" { L l; if (isIdentifier(m.unq(0))) l = ll(m.unq(0)); else l = (L) unstructure(m.unq(0)); // we used to have safeUnstructure here S method = getString(l, 0); if (!contains(methodNames, method)) fail("Method not allowed: " + method); ret ok2(structure(call(mc(), method, asObjectArray(subList(l, 1))))); } null; }