static S hijackPrint_tee(Runnable r) { final new StringBuilder buf; O old = interceptPrintInThisThread(new F1<S, Bool>() { Bool get(S s) { buf.append(s); true; } }); try { callF(r); ret str(buf); } finally { interceptPrintInThisThread(old); } }
Began life as a copy of #1011313
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: | #1012290 |
Snippet name: | hijackPrint_tee - hijack the print function for a function call, return printed contents, also print normally |
Eternal ID of this version: | #1012290/2 |
Text MD5: | 9b7ff48b1303b38cbd03e9ae58c57bad |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2017-11-27 12:47:59 |
Source code size: | 302 bytes / 15 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 432 / 469 |
Version history: | 1 change(s) |
Referenced in: | #1006654 - Standard functions list 2 (LIVE, continuation of #761) #1026171 - hijackPrint_tee_pcall |