| 1 | static class LHotwire extends LearnerImpl {
 | 
| 2 | static boolean cacheSnippets = true; | 
| 3 | static new (Tree)Map<Long, Class> cache; | 
| 4 | |
| 5 | static boolean debug; | 
| 6 | String programID; | 
| 7 | Class prog; | 
| 8 | |
| 9 |   *(String *programID) {}
 | 
| 10 | |
| 11 |   public void processInOut(Object in, Object out) {
 | 
| 12 | } | 
| 13 | |
| 14 |   public Object processIn(Object in) {
 | 
| 15 |     if (prog == null) {
 | 
| 16 | prog = cache.get(parseSnippetID(programID)); | 
| 17 |       if (prog == null) {
 | 
| 18 | if (debug) | 
| 19 |           debug("Loading " + programID);
 | 
| 20 | prog = hotwire(programID); | 
| 21 | if (cacheSnippets) | 
| 22 | cache.put(parseSnippetID(programID), prog); | 
| 23 | } | 
| 24 | } | 
| 25 | |
| 26 | set(prog, "in", in); | 
| 27 |     call(prog, "main", new Object[] {new String[0]});
 | 
| 28 | in = get(prog, "in"); | 
| 29 | if (debug) | 
| 30 | debug(programID + " returned: " + structure(in)); | 
| 31 | return in; | 
| 32 | } | 
| 33 | } | 
Began life as a copy of #1000532
download show line numbers debug dex old transpilations
Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
| Snippet ID: | #1000640 | 
| Snippet name: | LHotwire (learner, plugs in other sources) | 
| Eternal ID of this version: | #1000640/1 | 
| Text MD5: | b8f7746398d615e2893c13f1ec3866fb | 
| Author: | stefan | 
| Category: | |
| Type: | JavaX fragment (include) | 
| Public (visible to everyone): | Yes | 
| Archived (hidden from active list): | No | 
| Created/modified: | 2015-08-21 00:28:08 | 
| Source code size: | 841 bytes / 33 lines | 
| Pitched / IR pitched: | No / Yes | 
| Views / Downloads: | 963 / 1370 | 
| Referenced in: | [show references] |