Libraryless. Click here for Pure Java version (5020L/28K).
1 | sS lambda0Like hijackPrint(Runnable r) {
|
2 | new StringBuilder buf; |
3 | O old = interceptPrintInThisThread(new F1<S, Bool>() {
|
4 | public Bool get(S s) {
|
5 | buf.append(s); |
6 | false; |
7 | } |
8 | }); |
9 | try {
|
10 | r?.run(); |
11 | ret str(buf); |
12 | } finally {
|
13 | interceptPrintInThisThread(old); |
14 | } |
15 | } |
download show line numbers debug dex old transpilations
Travelled to 16 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ekrmjmnbrukm, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mowyntqkapby, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment
| Snippet ID: | #1011313 |
| Snippet name: | hijackPrint - hijack the print function for a function call, return printed contents; can be nested |
| Eternal ID of this version: | #1011313/12 |
| Text MD5: | f43d1a4939b31f3483eb75047c00c094 |
| Transpilation MD5: | 5f28b273d7ac9b9feb4678f705b13793 |
| Author: | stefan |
| Category: | javax |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2022-02-10 06:38:10 |
| Source code size: | 306 bytes / 15 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 867 / 1065 |
| Version history: | 11 change(s) |
| Referenced in: | [show references] |