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

6
LINES

< > BotCompany Repo | #1027129 - mapWithIndex

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

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

static <A, B> L<B> mapWithIndex(L<A> l, IF2<Int, A, B> f) {
  L<B> out = emptyList(l);
  for i over l:
    out.add(f.get(i, l.get(i)));
  ret out;
}

download  show line numbers  debug dex   

Travelled to 3 computer(s): mqqgnosmbjvj, tvejysmllsmz, xrpafgyirdlv

No comments. add comment

Snippet ID: #1027129
Snippet name: mapWithIndex
Eternal ID of this version: #1027129/4
Text MD5: fb26f5d96915a29b0ea3836f63007871
Transpilation MD5: c70514b2727ec985c2ea82d6270d4d0c
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-03-29 20:03:59
Source code size: 153 bytes / 6 lines
Pitched / IR pitched: No / No
Views / Downloads: 22 / 42
Version history: 3 change(s)
Referenced in: [show references]

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