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

11
LINES

< > BotCompany Repo | #1015635 // quickEval - anything that can be evaluated without side effects

JavaX fragment (include)

static O quickEval(S t) {
  if (isQuoted(t)) ret unquote(t);
  if (isInteger(t)) ret parseIntOrLong(t);
  if (isLongConstant(t)) ret parseLong(t);
  if (eq(t, "null")) ret null;
  if (eq(t, "false")) ret false;
  if (eq(t, "true")) ret true;
  if (isIdentifier(t)) ret getMC(t);
  if (isSnippetID(t)) ret t;
  throw quickFail("Can't quick eval: " + t);
}

Author comment

Began life as a copy of #1015634

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1015635
Snippet name: quickEval - anything that can be evaluated without side effects
Eternal ID of this version: #1015635/6
Text MD5: 4fb133bda47b6cadcaefa6136ff0ae5e
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-03-05 20:08:51
Source code size: 364 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 466 / 525
Version history: 5 change(s)
Referenced in: [show references]