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

18
LINES

< > BotCompany Repo | #1018344 // steppable_forEach

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

Libraryless. Click here for Pure Java version (2146L/14K).

static <A> Steppable steppable_forEach(Iterable<A> items, VF1<A> f) {
  ret steppable_forEach(items, (O) f);
}

static <A> Steppable steppable_forEach(Iterable<A> items, IVF1<A> f) {
  ret steppable_forEach(items, (O) f);
}

static <A> Steppable steppable_forEach(Iterable<A> items, O f) {
  ret new Steppable {
    Iterator<A> it = iterator(items);
    public bool step() { // return false if done
      if (!it.hasNext()) false;
      callF(f, it.next());
      true;
    }
  };
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1018344
Snippet name: steppable_forEach
Eternal ID of this version: #1018344/8
Text MD5: 8f6950432d95e876bac7ed428f1ec1fe
Transpilation MD5: 4d4242411e6d9a9291f02e0653418be6
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-11-25 19:52:04
Source code size: 499 bytes / 18 lines
Pitched / IR pitched: No / No
Views / Downloads: 428 / 485
Version history: 7 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1018353 - splittableSteppable_forEach