static S evalJava_prep(S code) { ret evalJava_prep(code, "calc"); } static S evalJava_prep(S code, S mainName) { ret evalJava_prep(code, mainName, ""); } static new ThreadLocal evalJava_prep_args; sS evalJava_prep(S code, S mainName, S preCode) { new EvalJavaPrep prep; LS tok = evalJava_prePrep(code, prep); code = tok_addReturn(tok); S returnType = containsReturnWithArgument(code) ? "Object" : "void"; S main = lines(prep.global) + "static " + returnType + " " + mainName + "(" + unnull(evalJava_prep_args!) + ") throws Exception {\n" + preCode + code + "\n" + "}"; ret main; }