static F1 codeWithHintsToFunctionOnString(S code, S hints) { code = trim(code); Class c; S methodName; if (isIdentifier(code)) { // name of standard function c = loadFunctions_cached_withInit(code); methodName = code; } else { c = veryQuickJava("sO calc(S s) {\n" + tok_addReturn(code) + "\n}"); methodName = 'calc; } final Method m = findMethod_precise(c, code, ""); if (m == null) fail("Not a method on a string: " + code); ret func(S s) -> A { (A) invokeMethod(m, null, s) }; }