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

14
LINES

< > BotCompany Repo | #1005761 // Test intercepting print() by thread [WORKS]

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

Libraryless. Click here for Pure Java version (873L/6K/21K).

1  
!752
2  
3  
p {
4  
  interceptPrintInThisThread(new F1<S, Bool>() {
5  
    Bool get(S s) {
6  
      print_raw("Here you go: " + quote(s) + "\n");
7  
      false;
8  
    }
9  
  });
10  
  print("Intercepted!");
11  
  thread {
12  
    print("Not intercepted.");
13  
  }
14  
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1005761
Snippet name: Test intercepting print() by thread [WORKS]
Eternal ID of this version: #1005761/4
Text MD5: 67b048c2e2397504e81ab24aa35b48c6
Transpilation MD5: 358a0a9a8d2cd15d74bc2c9d9b9685d7
Author: stefan
Category: javax
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-04-17 18:49:40
Source code size: 241 bytes / 14 lines
Pitched / IR pitched: No / No
Views / Downloads: 431 / 529
Version history: 3 change(s)
Referenced in: [show references]