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

26
LINES

< > BotCompany Repo | #1007852 // loadFunctions - instantly make a program out of a list of standard function names and hotwire it

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (8264L/58K).

1  
sbool loadFunctions_debug;
2  
static O loadFunctions_veryQuickJava;
3  
4  
static Class loadFunctions(S... functions) {
5  
  ret loadFunctions(asList(functions));
6  
}
7  
8  
static Class loadFunctions(Collection<S> functions, O... _) {
9  
  print("Compiling " + joinWithPlus(functions));
10  
  TreeSet<S> functionSet = new TreeSet<S>(functions);
11  
  StringBuilder buf = stringBuilder(appendNewLineIfNempty(stringPar header(_)));
12  
  for (S s : functionSet)
13  
    buf.append("please include function " + assertIdentifier(s) + ".\n");
14  
  long time = sysNow();
15  
  Class c;
16  
  if (loadFunctions_veryQuickJava != null)
17  
    c = (Class) callF(loadFunctions_veryQuickJava, str(buf));
18  
  else {
19  
    veryQuickJava_transpiled.set(""); // request transpilation
20  
    c = veryQuickJava(str(buf));
21  
    saveTranspiledStandardFunctions(functionSet, getAndClearThreadLocal(veryQuickJava_transpiled));
22  
  }
23  
  if (loadFunctions_debug)
24  
    done2_always(time, "loadFunctions: " + join(" ", functions));
25  
  ret c;
26  
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1007852
Snippet name: loadFunctions - instantly make a program out of a list of standard function names and hotwire it
Eternal ID of this version: #1007852/19
Text MD5: 6e956e101d896ee7d6a4ef71c90db012
Transpilation MD5: cb6819c4531857e43ff19e998fb2f097
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-01-23 23:00:52
Source code size: 977 bytes / 26 lines
Pitched / IR pitched: No / No
Views / Downloads: 553 / 624
Version history: 18 change(s)
Referenced in: [show references]