Libraryless. Click here for Pure Java version (7753L/43K).
1 | static record noeq /*mapMethodLike*/ FunctionCall(Object function, Object... args) implements Transformable/*, IJavaXExpr*/ {
|
2 | sS _fieldOrder = "function args"; |
3 | |
4 | // !customConstructor |
5 | *(Object *function, Object... *args) {
|
6 | if (empty(this.args)) this.args = null; |
7 | } |
8 | |
9 | *(Object function, L args) {
|
10 | this(function, toObjectArray(args)); |
11 | } |
12 | |
13 | toString {
|
14 | ret function + "(" + joinWithComma(allToString(args)) + ")";
|
15 | } |
16 | |
17 | S toStringWithOptionalParens() {
|
18 | ret empty(args) ? str(function) : toString(); |
19 | } |
20 | |
21 | public bool equals(O o) {
|
22 | ret o instanceof FunctionCall |
23 | && eq(function, o/FunctionCall.function) |
24 | && objectArraysEqual(args, o/FunctionCall.args); |
25 | } |
26 | |
27 | public int hashCode() {
|
28 | ret hashAboutObjects(function, asList(args)); |
29 | } |
30 | |
31 | L args() { ret asList(args); }
|
32 | |
33 | public Object transformUsing(IF1 f) {
|
34 | ret new FunctionCall(f.get(function), mapObjectArray(f, args)); |
35 | } |
36 | } |
download show line numbers debug dex old transpilations
Travelled to 8 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment
| Snippet ID: | #1021612 |
| Snippet name: | FunctionCall |
| Eternal ID of this version: | #1021612/23 |
| Text MD5: | 3f351a40228448526f688fc5f9bd2a42 |
| Transpilation MD5: | 3b7a1774b458e9357386930f6e48dc58 |
| Author: | stefan |
| Category: | javax |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2022-04-06 04:59:18 |
| Source code size: | 975 bytes / 36 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 678 / 1374 |
| Version history: | 22 change(s) |
| Referenced in: | [show references] |