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)

// f : L -> L
static L xtok_recurse_limited(O f, L l, int limit) {
  l = (L) callF(f, l);
  if (limit <= 1) ret l;
  for (int i = 1; i < l(l); i += 2) {
    O o = l.get(i);
    if (o instanceof L)
      l.set(i, xtok_recurse_limited(f, (L) o, limit-1));
  }
  ret l;
}

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: 521 / 568
Version history: 1 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1008805 - xtok_recurse_limited_debug