Warning: session_start(): open(/var/lib/php/sessions/sess_j6c1seotpginc6id1aae20au0s, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
static F1 codeToFunctionOnArbitraryType(S code, S type, Class javaType, S varName) {
code = trim(code);
Class c;
S methodName;
if (isIdentifier(code)) { // name of standard function
c = loadFunctions_cached_withInit(code);
methodName = code;
} else if (jcontains(code, "calc(")) { // code defines its own calc function
c = veryQuickJava(code);
methodName = 'calc;
} else { // code is an expression or block working on variable s
S main = "sO calc(final " + type + " " + varName + ") {\n" + tok_addReturn(code) + "\n}";
c = veryQuickJava(main);
methodName = 'calc;
}
final Method m = findMethod_precise(c, methodName, javaType);
if (m == null) fail("Not a method on " + javaType + ": " + code);
ret (F1) func(O o) -> O { invokeMethod(m, null, o) };
}