Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

19
LINES

< > BotCompany Repo | #1012129 // smartBotEval_noTimeout

JavaX fragment (include)

1  
static S smartBotEval_noTimeout(S expression) {
2  
  time2 {
3  
    fS main = smartBotEval_prelude() + evalJava_prep(expression, "calc", "ai_spec_init();\n");
4  
    print("--\n" + main + "\n--");
5  
    final new Var o;
6  
    final new Var<Throwable> error;
7  
    S printed = hijackPrint_tee(r {
8  
      try {
9  
        o.set(evalJava_myProgramID_main(main));
10  
      } catch print e {
11  
        error.set(e);
12  
      }
13  
    });
14  
    smartBot_savePrintLog(expression, printed);
15  
  }
16  
  if (error.has()) throw rethrow(error!);
17  
  S s = sfuOrText(o!);
18  
  ret "[" + lastTiming() + " ms]" + (containsNewLine(trim(s)) ? "\n\n" + s : " " + s);
19  
}

Author comment

Began life as a copy of #1011990

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1012129
Snippet name: smartBotEval_noTimeout
Eternal ID of this version: #1012129/7
Text MD5: 9fc2248eaf17b71306883a88f41c5020
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-05-12 23:54:13
Source code size: 626 bytes / 19 lines
Pitched / IR pitched: No / No
Views / Downloads: 487 / 533
Version history: 6 change(s)
Referenced in: [show references]