Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

15
LINES

< > BotCompany Repo | #1027750 // transform_understandsTransformableAndList

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (2541L/16K).

// meta-transform function that understands Transformable and List
// if f returns null, go through structure
sO lambdaMapLike transform_understandsTransformableAndList(IF1 f, O o) {
  if (o == null) null;
  ping();
  try object f.get(o);
  
  IF1 myself = x -> transform_understandsTransformableAndList(f, x);
  if (o cast Transformable)
    ret o.transformUsing(myself);
  if (o cast L)
    ret map(myself, o);
    
  fail("Don't know how to transform: " + className(o));
}

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: 137 / 225
Version history: 8 change(s)
Referenced in: [show references]