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

17
LINES

< > BotCompany Repo | #1017773 // Eval with dollar vars Spike [OK, -> evalWithDollarVars]

JavaX source code (desktop) [tags: use-pretranspiled] - run with: x30.jar

Download Jar. Libraryless. Click here for Pure Java version (7952L/58K).

!7

p-exp {
  S code = [[formatDouble(parseDouble($x) + parseDouble($y), 2)]];
  L<S> tok = javaTok(code);
  new LinkedHashSet<S> vars;
  for (int i = 1; i < l(tok); i += 2) {
    S t = tok.get(i);
    if (isDollarVar(t))
      vars.add(t);
  }
  temp tempSetThreadLocal(evalJava_prep_args, joinWithComma(map(func(S var) -> S { "S " + var }, vars)));
  S src = evalJava_prep(code);
  printIndent(src);
  O c = evalJava_prep2(src);
  assertEqualsVerbose("3.8", call(c, 'calc, "1.5", "2.3"));
}

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: #1017773
Snippet name: Eval with dollar vars Spike [OK, -> evalWithDollarVars]
Eternal ID of this version: #1017773/5
Text MD5: b3bc3a18b4d4f751031851c659d3b5a9
Transpilation MD5: 51178fc1c113d6afbd3c1aab6a6ca08b
Author: stefan
Category: javax
Type: JavaX source code (desktop)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-08-10 22:05:23
Source code size: 508 bytes / 17 lines
Pitched / IR pitched: No / No
Views / Downloads: 433 / 980
Version history: 4 change(s)
Referenced in: [show references]