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

20
LINES

< > BotCompany Repo | #1014541 // mapCodeTokens - keeps N tokens as they are

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

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

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

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv

No comments. add comment

Snippet ID: #1014541
Snippet name: mapCodeTokens - keeps N tokens as they are
Eternal ID of this version: #1014541/6
Text MD5: 46c8dab77a158c17028d536a2bba3d3e
Transpilation MD5: fabfd000759905e51acbd453431929f1
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-07-12 12:32:45
Source code size: 406 bytes / 20 lines
Pitched / IR pitched: No / No
Views / Downloads: 429 / 582
Version history: 5 change(s)
Referenced in: [show references]