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

11
LINES

< > BotCompany Repo | #1029092 - iterateListWithIndex

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

Transpiled version (2652L) is out of date.

static <A> ItIt<Pair<Int, A>> iterateListWithIndex(Cl<A> l, int startAt default 0) {
  ret iff(new O {
    Iterator it = iterator(l);
    int i = startAt;
    
    public O get() {
      if (!it.hasNext()) ret endMarker();
      ret pair(i++, it.next());
    }
  });
}

download  show line numbers  debug dex   

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

No comments. add comment

Snippet ID: #1029092
Snippet name: iterateListWithIndex
Eternal ID of this version: #1029092/7
Text MD5: 9589c87f46b3e37edc07d28c6cbd3deb
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-12-18 18:37:35
Source code size: 278 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 58 / 96
Version history: 6 change(s)
Referenced in: [show references]

Formerly at http://tinybrain.de/1029092 & http://1029092.tinybrain.de