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

11
LINES

< > BotCompany Repo | #1008804 // xtok_recurse_limited

JavaX fragment (include)

1  
// f : L -> L
2  
static L xtok_recurse_limited(O f, L l, int limit) {
3  
  l = (L) callF(f, l);
4  
  if (limit <= 1) ret l;
5  
  for (int i = 1; i < l(l); i += 2) {
6  
    O o = l.get(i);
7  
    if (o instanceof L)
8  
      l.set(i, xtok_recurse_limited(f, (L) o, limit-1));
9  
  }
10  
  ret l;
11  
}

Author comment

Began life as a copy of #1008802

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1008804
Snippet name: xtok_recurse_limited
Eternal ID of this version: #1008804/2
Text MD5: 8a8c04ca85a0c11fbb7516287db80318
Author: stefan
Category: javax / parsing
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-06-09 02:22:42
Source code size: 278 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 522 / 569
Version history: 1 change(s)
Referenced in: [show references]