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

33
LINES

< > BotCompany Repo | #1016755 // Java Eval [Evaluate Java Code, Dyn Module]

JavaX source code (Dynamic Module) [tags: use-pretranspiled] - run with: Stefan's OS

Uses 108K of libraries. Compilation Failed (19354L/142K).

1  
!7
2  
3  
!include once #1017126 // transpileRaw
4  
5  
sclass JavaEval extends DynPrintLog {
6  
  S expression;
7  
  transient bool calculating;
8  
  transient O value;
9  
  transient JTextField tfInput;
10  
  transient Throwable error;
11  
  
12  
  JComponent visualize() {
13  
    ret northAndCenterWithMargins(
14  
      centerAndEastWithMarginInbetween(
15  
        tfInput = onEnter(jtextfield(expression), rThread evalIt),
16  
        hstackWithSpacing(
17  
          jbutton("Fresh", rThread { refresh(); evalIt() }),
18  
          jbutton("Eval", rThread evalIt))),
19  
      super.visualize());
20  
  }
21  
  
22  
  void refresh {
23  
    call(dm_transpiler(), 'refresh);
24  
    print("Refreshed translator.");
25  
  }
26  
  
27  
  void evalIt {
28  
    if (calculating) ret;
29  
    calculating = true;
30  
    temp tempAfterwards(r { calculating = false });
31  
    dm_javaEvalModule_doIt(gtt(tfInput));
32  
  }
33  
}

Author comment

Began life as a copy of #1016083

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1016755
Snippet name: Java Eval [Evaluate Java Code, Dyn Module]
Eternal ID of this version: #1016755/27
Text MD5: d68347ba99c84db199a6a0cb3445bf00
Transpilation MD5: ced0cdaf912e8c670cf31eaa2bb98745
Author: stefan
Category: javax / stefan's os
Type: JavaX source code (Dynamic Module)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-07-27 23:03:09
Source code size: 842 bytes / 33 lines
Pitched / IR pitched: No / No
Views / Downloads: 428 / 28013
Version history: 26 change(s)
Referenced in: [show references]