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 (2554L) is out of date.

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

download  show line numbers  debug dex   

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

No comments. add comment

Snippet ID: #1029092
Snippet name: iterateListWithIndex
Eternal ID of this version: #1029092/6
Text MD5: e9ffccd31cc858f6b783aba084057d14
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-07-19 14:01:51
Source code size: 245 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 40 / 67
Version history: 5 change(s)
Referenced in: [show references]

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