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

15
LINES

< > BotCompany Repo | #1027751 // transform_understandsTransformableAndList_keepUnknown

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_keepUnknown(IF1 f, O o) {
  if (o == null) null;
  ping();
  try object f.get(o);
  
  IF1 myself = x -> transform_understandsTransformableAndList_keepUnknown(f, x);
  if (o cast Transformable)
    ret o.transformUsing(myself);
  if (o cast L)
    ret map(myself, o);
    
  ret o;
}

Author comment

Began life as a copy of #1027750

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: #1027751
Snippet name: transform_understandsTransformableAndList_keepUnknown
Eternal ID of this version: #1027751/1
Text MD5: c5f09412e07262523c86c423690729c2
Transpilation MD5: fc02bb3b1d97ed033ad45d582fb92e34
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:01:30
Source code size: 466 bytes / 15 lines
Pitched / IR pitched: No / No
Views / Downloads: 188 / 264
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1027774 - MetaTransformer
#1027775 - metaTransformer_transformableAndList