Warning: session_start(): open(/var/lib/php/sessions/sess_0ugpdv58ef9l4gr2gft9ds626b, 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
sbool codeWithHintsToFunctionOnString_verbose;
static F1 codeWithHintsToFunctionOnString(S code) {
ret codeWithHintsToFunctionOnString(code, "");
}
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 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(fS s) {\n" + tok_addReturn(code) + "\n}";
if (codeWithHintsToFunctionOnString_verbose) print(main);
c = veryQuickJava(main);
if (codeWithHintsToFunctionOnString_verbose) print(c);
methodName = 'calc;
}
final Method m = findMethod_precise(c, methodName, "");
if (m == null) fail("Not a method on a string: " + code);
ret func(S s) -> A { (A) invokeMethod(m, null, s) };
}