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

20
LINES

< > BotCompany Repo | #1029679 // mapNonCodeTokens - keeps C tokens as they are

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

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

1  
static L mapNonCodeTokens(O f, L l) {
2  
  L out = emptyList(l);
3  
  for i over l: {
4  
    O o = l.get(i);
5  
    out.add(even(i) ? callF(f, o) : o);
6  
  }
7  
  ret out;
8  
}
9  
10  
static L mapNonCodeTokens(L l, O f) {
11  
  ret mapNonCodeTokens(f, l);
12  
}
13  
14  
static LS mapNonCodeTokens(LS tok, IF1<S> f) {
15  
  ret mapNonCodeTokens(tok, (O) f);
16  
}
17  
18  
static LS lambdaMapLike mapNonCodeTokens(IF1<S> f, LS tok) {
19  
  ret mapNonCodeTokens(tok, f);
20  
}

Author comment

Began life as a copy of #1014541

download  show line numbers  debug dex  old transpilations   

Travelled to 6 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1029679
Snippet name: mapNonCodeTokens - keeps C tokens as they are
Eternal ID of this version: #1029679/1
Text MD5: d901149d3c8bf3d62418b22fe342a96d
Transpilation MD5: 2473d2f4dd45b5bf3fc1972dbc3fa376
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-09-07 12:29:30
Source code size: 428 bytes / 20 lines
Pitched / IR pitched: No / No
Views / Downloads: 170 / 247
Referenced in: [show references]