Download Jar. Libraryless. Click here for Pure Java version (1781L/12K).
1 | !7 |
2 | |
3 | sclass Calculation { |
4 | O f; |
5 | OKOrError result; |
6 | |
7 | *() {} |
8 | *(O *f) {} |
9 | |
10 | void calc() { |
11 | try { |
12 | result = OKOrError_ok(callF(f)); |
13 | } catch e { |
14 | result = OKOrError_error(e); |
15 | } |
16 | } |
17 | } |
18 | |
19 | p { |
20 | Calculation c = new Calculation(f now); |
21 | c.calc(); |
22 | print("Result: " + c.result); |
23 | |
24 | c = new Calculation(f fail); |
25 | c.calc(); |
26 | print("Result: " + c.result); |
27 | } |
download show line numbers debug dex old transpilations
Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1012583 |
Snippet name: | Reified Calculation v1 [OK] |
Eternal ID of this version: | #1012583/6 |
Text MD5: | 57bce34c62f2c1626da8348c47a2c8d3 |
Transpilation MD5: | c93bc7ebeebbba7382fc02eb3367703d |
Author: | stefan |
Category: | javax |
Type: | JavaX source code (desktop) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2017-12-07 14:36:50 |
Source code size: | 404 bytes / 27 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 511 / 1086 |
Version history: | 5 change(s) |
Referenced in: | [show references] |