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

12
LINES

< > BotCompany Repo | #1002662 // isTrue - synonym of booleanValue

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

Libraryless. Click here for Pure Java version (2698L/16K).

sbool isTrue(O o) {
  if (o instanceof Boolean)
    ret ((Boolean) o).booleanValue();
  if (o == null) ret false;
  if (o instanceof ThreadLocal) // TODO: remove this
    ret isTrue(((ThreadLocal) o).get());
  fail(getClassName(o));
}

sbool isTrue(Bool b) {
  ret b != null && b.booleanValue();
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1002662
Snippet name: isTrue - synonym of booleanValue
Eternal ID of this version: #1002662/6
Text MD5: 93c3b79e27c21d516a8977540940a063
Transpilation MD5: e150a3db9ab5b31c232c1418c5ff8838
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-01-02 17:35:19
Source code size: 308 bytes / 12 lines
Pitched / IR pitched: No / No
Views / Downloads: 971 / 8148
Version history: 5 change(s)
Referenced in: #1003872 - Integrating #759 in One Program
#1003874 - Backup of #759 Before Integration
#1004091 - 759 with new loadClasses (spike)
#1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1006723 - Higher-Level-Transpiled #759 Spike [old]
#1006724 - Backup of #759 before switching to higher-level-translation
#1007595 - "Super-Edgy" JavaX Translator (Extension of #752) [dev., broken]
#1007935 - isTrue for coroutines
#1010083 - Backup of "Super-Edgy" JavaX Translator (Extension of #7)
#1010084 - Speeding up "Super-Edgy" JavaX Translator (Extension of #7)
#1010087 - Speeding up "Super-Edgy" JavaX Translator (Extension of #7) 2
#1012937 - isTrue_able
#1017062 - isTrueOpt
#3000382 - Answer for ferdie (>> t = 1, f = 0)