Libraryless. Click here for Pure Java version (2541L/16K).
1 | // meta-transform function that understands Transformable and List |
2 | // if f returns null, go through structure |
3 | sO lambdaMapLike transform_understandsTransformableAndList(IF1 f, O o) { |
4 | if (o == null) null; |
5 | ping(); |
6 | try object f.get(o); |
7 | |
8 | IF1 myself = x -> transform_understandsTransformableAndList(f, x); |
9 | if (o cast Transformable) |
10 | ret o.transformUsing(myself); |
11 | if (o cast L) |
12 | ret map(myself, o); |
13 | |
14 | fail("Don't know how to transform: " + className(o)); |
15 | } |
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment
Snippet ID: | #1027750 |
Snippet name: | transform_understandsTransformableAndList |
Eternal ID of this version: | #1027750/9 |
Text MD5: | f99dc858a8cb3078d15d3b7bf17c3029 |
Transpilation MD5: | fabf519e1d8bb6af755c5a95a29a61e5 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2020-04-10 00:00:11 |
Source code size: | 489 bytes / 15 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 233 / 383 |
Version history: | 8 change(s) |
Referenced in: | [show references] |