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

12
LINES

< > BotCompany Repo | #1029194 // countIterator_exclusive_backwards - count from a to b (exclusively)

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

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

static ItIt<Int> countIterator_exclusive_backwards(int a, int b) {
  ret new ItIt<Int>() {
    int i = a;
    
    public bool hasNext() { ret i > b; }
    public Int next() { ret i--; }
  };
}

static <A> ItIt<A> countIterator_exclusive_backwards(int a, int b, IF1<Int, A> f) {
  ret mapI_if1(f, countIterator_exclusive_backwards(a, b));
}

Author comment

Began life as a copy of #1018109

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1029194
Snippet name: countIterator_exclusive_backwards - count from a to b (exclusively)
Eternal ID of this version: #1029194/4
Text MD5: 4245da4c484e4c20a9032aa6bb8d4c2b
Transpilation MD5: 410d73c319ea2cb46b2fbc611bccc80e
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-07-30 00:33:22
Source code size: 351 bytes / 12 lines
Pitched / IR pitched: No / No
Views / Downloads: 206 / 297
Version history: 3 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1033950 - countIterator_inclusive_backwards - count from a to b (inclusively)