Libraryless. Click here for Pure Java version (13217L/84K).
1 | srecord noeq DMEvalJava(S expression) { |
2 | O mod = dm_current_generic(); |
3 | O[] args; // probably not a thing anymore |
4 | bool makeDependent = true; |
5 | |
6 | S preppedCode; |
7 | O obj; |
8 | |
9 | O get() { |
10 | prepCode(); |
11 | obj = veryQuickJava(preppedCode); |
12 | setVars(obj); |
13 | makeDependent(obj); |
14 | dm_pointSubmoduleToMe(obj, mod); |
15 | ret callIt(); |
16 | } |
17 | |
18 | O callIt() { |
19 | ret evalJava_myProgramID_main_2(obj, args); |
20 | } |
21 | |
22 | swappable void prepCode() { |
23 | preppedCode = evalJava_prep(expression) + postlude(); |
24 | } |
25 | |
26 | swappable O veryQuickJava(S mainJava) { |
27 | ret main veryQuickJava(mainJava); |
28 | } |
29 | |
30 | swappable void setVars(O obj) { |
31 | setOpt(obj, programID := programID()); |
32 | setOpt(obj, creator_class := newWeakReference(dm_os())); |
33 | } |
34 | |
35 | S postlude() { |
36 | ret [[ |
37 | static new InheritableThreadLocal<WeakReference> dm_currentModule_value; |
38 | |
39 | sO dm_current_mandatory_generic_value; |
40 | |
41 | sO dm_current_mandatory_generic() { ret dm_current_mandatory_generic_value; } |
42 | sO dm_current_generic() { ret dm_current_mandatory_generic(); } |
43 | ]]; |
44 | } |
45 | } |
Began life as a copy of #1019381
download show line numbers debug dex old transpilations
Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj
No comments. add comment
Snippet ID: | #1033178 |
Snippet name: | DMEvalJava - successor of dm_evalJava_withModule |
Eternal ID of this version: | #1033178/3 |
Text MD5: | a289bb133e3ac17639e0235582b39fa4 |
Transpilation MD5: | e7844a30ef8ac67fa1be239080b0b2b0 |
Author: | stefan |
Category: | javax / stefan's os |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2021-10-15 23:23:54 |
Source code size: | 1119 bytes / 45 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 137 / 238 |
Version history: | 2 change(s) |
Referenced in: | [show references] |